New UI finished, and image showing! [#2]
This commit is contained in:
parent
d513b00711
commit
846ea7be39
6
.idea/render.experimental.xml
Normal file
6
.idea/render.experimental.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RenderSettings">
|
||||
<option name="showDecorations" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,52 @@
|
||||
package ru.volgorobot.vrcatalog.additional;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
|
||||
public class PropertiesListAdapter extends BaseAdapter {
|
||||
private LinkedHashMap<String, String> mData;
|
||||
private String[] mKeys;
|
||||
|
||||
public PropertiesListAdapter(LinkedHashMap<String, String> data) {
|
||||
mData = data;
|
||||
mKeys = mData.keySet().toArray(new String[data.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mData.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return mData.get(mKeys[position]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
final View result;
|
||||
|
||||
if (convertView == null) {
|
||||
result = LayoutInflater.from(parent.getContext()).inflate(R.layout.properties_list_adapter, parent, false);
|
||||
} else {
|
||||
result = convertView;
|
||||
}
|
||||
|
||||
((TextView) result.findViewById(R.id.propertyNameView)).setText(mKeys[position]);
|
||||
((TextView) result.findViewById(R.id.propertyValueView)).setText(getItem(position).toString());
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
19
app/src/main/res/layout/properties_list_adapter.xml
Normal file
19
app/src/main/res/layout/properties_list_adapter.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/propertyNameView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Property Name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/propertyValueView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Property Value" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user