ajout éléments
This commit is contained in:
@@ -10,6 +10,9 @@ import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
@@ -21,6 +24,7 @@ import android.widget.ListView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -146,14 +150,19 @@ public class MainActivity extends AppCompatActivity {
|
||||
String homepage = object.getString("homepage");
|
||||
String url = object.getString("url");
|
||||
String favicon = object.getString("favicon");
|
||||
String tags = object.getString("tags");
|
||||
String language = object.getString("language");
|
||||
|
||||
HashMap<String, String> data = new HashMap<>();
|
||||
data.put("name", name);
|
||||
data.put("homepage", homepage);
|
||||
data.put("url", url);
|
||||
data.put("favicon", favicon);
|
||||
data.put("tags", tags);
|
||||
data.put("language", language);
|
||||
arrayList.add(data);
|
||||
ListAdapter adapter = new SimpleAdapter(MainActivity.this, arrayList, R.layout.list_items
|
||||
, new String[]{"name", "homepage", "url"}, new int[]{R.id.name, R.id.homepage, R.id.url});
|
||||
, new String[]{"name", "tags", "language"}, new int[]{R.id.name, R.id.tags, R.id.lang});
|
||||
listView.setAdapter(adapter);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
||||
@@ -17,26 +17,26 @@
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight="0.5"
|
||||
android:textSize="18sp"
|
||||
android:textSize="30dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black" />
|
||||
<TextView
|
||||
android:id="@+id/homepage"
|
||||
android:text="homepage"
|
||||
android:layout_weight="0.5"
|
||||
android:id="@+id/tags"
|
||||
android:text="tags"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#5d5d5d"
|
||||
android:textSize="20dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/url"
|
||||
android:text="utl"
|
||||
android:layout_weight="0.5"
|
||||
android:id="@+id/lang"
|
||||
android:text="lang"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#5d5d5d"
|
||||
android:textSize="20dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user