mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Implemented backport version of simple_list_item_2 for Material Design
and removed custom secondary text color on older Android versions
This commit is contained in:
parent
9ffa61f70b
commit
ae7ef84396
6 changed files with 31 additions and 7 deletions
|
@ -12,6 +12,7 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import be.digitalia.fosdem.R;
|
||||
import be.digitalia.fosdem.activities.TrackScheduleActivity;
|
||||
import be.digitalia.fosdem.db.DatabaseManager;
|
||||
|
@ -111,7 +112,7 @@ public class TracksListFragment extends SmoothListFragment implements LoaderCall
|
|||
|
||||
@Override
|
||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||
View view = inflater.inflate(android.R.layout.simple_list_item_2, parent, false);
|
||||
View view = inflater.inflate(R.layout.simple_list_item_2_material, parent, false);
|
||||
|
||||
ViewHolder holder = new ViewHolder();
|
||||
holder.name = (TextView) view.findViewById(android.R.id.text1);
|
||||
|
|
|
@ -8,7 +8,7 @@ import be.digitalia.fosdem.R;
|
|||
|
||||
public class Track implements Parcelable {
|
||||
|
||||
public static enum Type {
|
||||
public enum Type {
|
||||
other(R.string.other),
|
||||
keynote(R.string.keynote),
|
||||
maintrack(R.string.main_track),
|
||||
|
@ -18,10 +18,11 @@ public class Track implements Parcelable {
|
|||
|
||||
private final int nameResId;
|
||||
|
||||
private Type(@StringRes int nameResId) {
|
||||
Type(@StringRes int nameResId) {
|
||||
this.nameResId = nameResId;
|
||||
}
|
||||
|
||||
@StringRes
|
||||
public int getNameResId() {
|
||||
return nameResId;
|
||||
}
|
||||
|
|
26
app/src/main/res/layout/simple_list_item_2_material.xml
Normal file
26
app/src/main/res/layout/simple_list_item_2_material.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/list_item_padding"
|
||||
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
|
||||
android:paddingRight="?attr/listPreferredItemPaddingRight"
|
||||
android:paddingTop="@dimen/list_item_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?attr/textAppearanceListItem"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?attr/textAppearanceListItem"
|
||||
android:textSize="@dimen/abc_text_size_small_material"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -4,7 +4,6 @@
|
|||
<!-- Main theme -->
|
||||
|
||||
<style name="AppTheme" parent="Base.AppTheme">
|
||||
<item name="android:textColorSecondary">@color/secondary_text</item>
|
||||
<item name="android:progressBarStyleHorizontal">@style/ProgressBar.Fosdem</item>
|
||||
<item name="android:fastScrollThumbDrawable">@drawable/fosdem_fastscroll_thumb_holo</item>
|
||||
<item name="android:selectableItemBackground">?attr/selectableItemBackground</item>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<color name="color_primary_dark">#76005e</color>
|
||||
<color name="color_accent">#3479c4</color>
|
||||
<color name="fosdem_blue_translucent">#663479c4</color>
|
||||
<color name="secondary_text">#323232</color>
|
||||
<color name="main_menu_background">#fffafafa</color>
|
||||
<color name="translucent_grey">#0c000000</color>
|
||||
<color name="schedule_time_background">#29000000</color>
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Base.AppTheme">
|
||||
<!-- Secondary text color is used more prominently on older devices; use the classic one -->
|
||||
<item name="android:textColorSecondary">@color/secondary_text</item>
|
||||
<item name="android:progressBarStyleHorizontal">@style/ProgressBar.Fosdem</item>
|
||||
<item name="android:listViewStyle">@style/ListView.Fosdem</item>
|
||||
<item name="android:scrollViewStyle">@style/ScrollView.Fosdem</item>
|
||||
|
|
Loading…
Reference in a new issue