Add application mode indication

This commit is contained in:
alex 2017-11-09 17:18:25 +02:00
parent 561814bd0c
commit 52cd86f137
2 changed files with 41 additions and 11 deletions

View file

@ -18,9 +18,14 @@
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<net.osmand.plus.widgets.TextViewEx
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
@ -28,6 +33,25 @@
android:textColor="@color/color_white"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/app_mode_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textAllCaps="true"
android:textColor="@color/color_white"
android:textSize="@dimen/default_desc_text_size"
tools:drawableRight="@drawable/ic_action_car_dark"
tools:text="car"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<ScrollView

View file

@ -21,6 +21,7 @@ import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.MapMarkersMode;
import net.osmand.plus.OsmandSettings.OsmandPreference;
@ -50,7 +51,7 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
mainView = inflater.inflate(R.layout.fragment_direction_indication_dialog, container);
Toolbar toolbar = mainView.findViewById(R.id.toolbar);
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getIconsCache().getIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@ -59,6 +60,11 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
}
});
TextView appModeTv = (TextView) mainView.findViewById(R.id.app_mode_text_view);
ApplicationMode appMode = settings.APPLICATION_MODE.get();
appModeTv.setText(appMode.getStringResource());
appModeTv.setCompoundDrawablesWithIntrinsicBounds(null, null, getIconsCache().getIcon(appMode.getSmallIconDark()), null);
updateHelpImage();
final TextView menuTv = (TextView) mainView.findViewById(R.id.active_markers_text_view);