Small fixes
This commit is contained in:
parent
3d15fb9659
commit
f3dcfb25c5
3 changed files with 10 additions and 8 deletions
|
@ -52,6 +52,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="7dp"
|
android:layout_marginRight="7dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lines="1"
|
||||||
android:textColor="?android:textColorSecondary"
|
android:textColor="?android:textColorSecondary"
|
||||||
android:textSize="@dimen/default_sub_text_size"
|
android:textSize="@dimen/default_sub_text_size"
|
||||||
tools:text="Last Update: 1 Dec 2015"/>
|
tools:text="Last Update: 1 Dec 2015"/>
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.base;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.support.annotation.ColorInt;
|
import android.support.annotation.ColorInt;
|
||||||
|
import android.support.annotation.ColorRes;
|
||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.annotation.IdRes;
|
import android.support.annotation.IdRes;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
@ -34,6 +35,10 @@ public class BaseOsmAndFragment extends Fragment {
|
||||||
return getIconsCache().getPaintedContentIcon(id, color);
|
return getIconsCache().getPaintedContentIcon(id, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId){
|
||||||
|
return getIconsCache().getIcon(id, colorId);
|
||||||
|
}
|
||||||
|
|
||||||
protected Drawable getContentIcon(@DrawableRes int id){
|
protected Drawable getContentIcon(@DrawableRes int id){
|
||||||
return getIconsCache().getContentIcon(id);
|
return getIconsCache().getContentIcon(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v7.widget.SwitchCompat;
|
import android.support.v7.widget.SwitchCompat;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
@ -28,7 +27,7 @@ import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.LocalIndexHelper;
|
import net.osmand.plus.activities.LocalIndexHelper;
|
||||||
import net.osmand.plus.activities.LocalIndexInfo;
|
import net.osmand.plus.activities.LocalIndexInfo;
|
||||||
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
|
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
|
||||||
import net.osmand.plus.download.AbstractDownloadActivity;
|
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||||
import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask;
|
import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask;
|
||||||
import net.osmand.plus.resources.IncrementalChangesManager;
|
import net.osmand.plus.resources.IncrementalChangesManager;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
@ -53,7 +52,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceTimeOfDayT
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
|
||||||
|
|
||||||
public class LiveUpdatesFragment extends Fragment {
|
public class LiveUpdatesFragment extends BaseOsmAndFragment {
|
||||||
public static final String TITLE = "Live Updates";
|
public static final String TITLE = "Live Updates";
|
||||||
public static final Comparator<LocalIndexInfo> LOCAL_INDEX_INFO_COMPARATOR = new Comparator<LocalIndexInfo>() {
|
public static final Comparator<LocalIndexInfo> LOCAL_INDEX_INFO_COMPARATOR = new Comparator<LocalIndexInfo>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -98,10 +97,6 @@ public class LiveUpdatesFragment extends Fragment {
|
||||||
return getMyActivity().getMyApplication().getSettings();
|
return getMyActivity().getMyApplication().getSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractDownloadActivity getMyActivity() {
|
|
||||||
return (AbstractDownloadActivity) getActivity();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void notifyLiveUpdatesChanged() {
|
public void notifyLiveUpdatesChanged() {
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
adapter.notifyLiveUpdatesChanged();
|
adapter.notifyLiveUpdatesChanged();
|
||||||
|
@ -346,7 +341,7 @@ public class LiveUpdatesFragment extends Fragment {
|
||||||
subheaderTextView.setText(subheaderText);
|
subheaderTextView.setText(subheaderText);
|
||||||
subheaderTextView.setTextColor(fragment.getActivity().getResources()
|
subheaderTextView.setTextColor(fragment.getActivity().getResources()
|
||||||
.getColor(R.color.osmand_orange));
|
.getColor(R.color.osmand_orange));
|
||||||
icon.setImageDrawable(context.getIconsCache().getIcon(R.drawable.ic_map, R.color.osmand_orange));
|
icon.setImageDrawable(fragment.getIcon(R.drawable.ic_map, R.color.osmand_orange));
|
||||||
options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_overflow_menu_white));
|
options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_overflow_menu_white));
|
||||||
layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_ENABLED_ITEM_HEIGHT);
|
layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_ENABLED_ITEM_HEIGHT);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue