Updated dialogs, icons in osmo groups activity

This commit is contained in:
Bars107 2015-03-12 18:48:30 +02:00
parent 9a44a5ff1a
commit 32523d5dc4
16 changed files with 397 additions and 347 deletions

View file

@ -1,91 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/osmo_header_background"
android:minHeight="@dimen/osmo_header_height"
android:orientation="horizontal"
android:paddingLeft="@dimen/dashboard_parking_left_margin"
android:paddingRight="@dimen/dashboard_parking_left_margin">
<ImageView
android:id="@+id/osmo_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/mon_osmo_conn_small" />
<ImageView
android:id="@+id/osmo_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/mon_osmo_conn_small"/>
<Switch
android:id="@+id/enable_service"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:gravity="center_vertical"
android:text="@string/osmo_start_service" />
</LinearLayout>
<Switch
android:id="@+id/enable_service"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:focusable="false"
android:textColor="@color/color_white"
android:text="@string/osmo_start_service"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/osmo_log_off_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp" >
<RelativeLayout
android:id="@+id/osmo_log_off_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dashboard_parking_left_margin"
android:layout_marginRight="@dimen/dashboard_parking_left_margin"
android:minHeight="@dimen/osmo_header_height">
<TextView
android:id="@+id/osmo_user_name_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/anonymous_user"
android:textAppearance="?android:attr/textAppearance" />
<TextView
android:id="@+id/osmo_user_name_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/anonymous_user"
android:textAppearance="?android:attr/textAppearance"/>
<Switch
android:id="@+id/osmo_login_logoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:focusable="false"
android:gravity="center_vertical" />
<Switch
android:id="@+id/osmo_login_logoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:focusable="false"
android:gravity="center_vertical"/>
<Button
android:id="@+id/osmo_login_hint_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/osmo_user_name_text_view"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="\?"
android:textAppearance="?android:attr/textAppearance" />
</RelativeLayout>
<Button
android:id="@+id/osmo_login_hint_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/osmo_user_name_text_view"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="\?"
android:textAppearance="?android:attr/textAppearance"/>
<Switch
android:id="@+id/enable_tracker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp"
android:gravity="center_vertical"
android:text="@string/osmo_enable_tracker" />
</RelativeLayout>
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dip"
android:autoLink="web"
android:gravity="center"
android:textSize="18sp" />
<Switch
android:id="@+id/enable_tracker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dashboard_parking_left_margin"
android:layout_marginRight="@dimen/dashboard_parking_left_margin"
android:focusable="false"
android:gravity="center_vertical"
android:minHeight="@dimen/osmo_header_height"
android:text="@string/osmo_enable_tracker"/>
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dip"
android:autoLink="web"
android:gravity="center"
android:textSize="18sp"/>
</LinearLayout>

View file

@ -1,101 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="@dimen/dialog_content_bottom_margin"
android:paddingLeft="@dimen/dialog_content_margin"
android:paddingRight="@dimen/dialog_content_margin"
android:paddingTop="@dimen/dialog_content_bottom_margin">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1">
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_name"/>
<TextView
android:paddingLeft="3dp"
android:layout_span="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/osmo_group_create_info"
android:textSize="18sp"
android:drawableRight="@drawable/ic_action_info_dark"
android:text="@string/osmo_group_information" />
</TableRow>
<TableRow>
<TextView
android:paddingLeft="3dp"
android:id="@+id/osmo_group_create_dinfo"
android:textSize="16sp"
android:layout_span="2"
android:minLines="3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_information_desc"
android:animateLayoutChanges="true"
android:visibility="gone" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_name" />
<EditText
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_description" />
<EditText
android:id="@+id/Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="3"
android:paddingLeft="3dp" />
</TableRow>
<EditText
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_description"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_by_invite" />
<EditText
android:id="@+id/Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<CheckBox
android:id="@+id/OnlyByInvite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_policy"/>
<TableRow>
<EditText
android:id="@+id/Policy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_policy" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Policy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="2"
android:paddingLeft="3dp" />
</TableRow>
</TableLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_by_invite"/>
<CheckBox
android:id="@+id/OnlyByInvite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/osmo_group_create_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/osmo_group_information"
android:textSize="18sp"/>
<ImageButton
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/options_button_background"
android:src="@drawable/ic_action_info_dark"/>
</LinearLayout>
<TextView
android:id="@+id/osmo_group_create_dinfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_information_desc"
android:textSize="16sp"
android:visibility="gone"/>
</LinearLayout>
</ScrollView>

View file

@ -2,8 +2,10 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:paddingBottom="@dimen/dialog_content_bottom_margin"
android:paddingTop="@dimen/dialog_content_bottom_margin"
android:paddingLeft="@dimen/dialog_content_margin"
android:paddingRight="@dimen/dialog_content_margin"
android:stretchColumns="1">
<TableRow>

View file

@ -1,37 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/expandable_category_color"
android:paddingBottom="5dp"
android:paddingLeft="3dp"
android:paddingRight="4dp"
android:paddingTop="5dp">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="3dp"
android:paddingRight="4dp"
android:paddingTop="5dp">
<ImageView
android:id="@+id/explist_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="6dp"
android:src="@drawable/expandable_category_unpushed" />
<ImageView
android:id="@+id/explist_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="6dp"
android:src="@drawable/expandable_category_unpushed"/>
<TextView
android:id="@+id/category_name"
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="?android:textColorPrimary"
android:layout_marginLeft="8dp"
<TextView
android:id="@+id/category_name"
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:maxLines="1"
tools:text="@string/lorem_ipsum"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:textSize="18sp" />
android:textColor="?android:textColorPrimary"
android:textSize="18sp"
tools:text="@string/lorem_ipsum"/>
<include layout="@layout/check_item_rel" />
<include layout="@layout/check_item_rel"/>
<ImageView

View file

@ -25,4 +25,10 @@
android:layout_weight="1"
android:groupIndicator="@android:color/transparent"/>
<net.osmand.plus.activities.search.toolbar.SplitToolbar
android:id="@+id/bottomControls"
android:background="?attr/bottomToolBarColor"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -1,36 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingLeft="8dp"
android:paddingRight="4dp"
android:paddingTop="5dp">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/expandable_list_item_background"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingLeft="8dp"
android:paddingRight="4dp"
android:paddingTop="5dp">
<ImageView
android:id="@+id/osmo_user_icon"
android:layout_width="26dp"
android:layout_height="26dp"
android:paddingRight="2dp"
android:paddingTop="2dp" />
<ImageView
android:id="@+id/osmo_user_icon"
android:layout_width="26dp"
android:layout_height="26dp"
android:paddingRight="2dp"
android:paddingTop="2dp"/>
<TextView
android:id="@+id/osmo_label"
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxLines="7"
android:layout_weight="1" />
<TextView
android:id="@+id/osmo_label"
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:maxLines="7"
tools:text="@string/abc_action_bar_home_description"
android:textColor="?android:textColorPrimary"/>
<TextView
android:id="@+id/osmo_label_time"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp" />
<TextView
android:id="@+id/osmo_label_time"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"/>
<!-- <include layout="@layout/check_item" /> -->
<!-- <include layout="@layout/check_item" /> -->
</LinearLayout>

View file

@ -1,91 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/osmo_header_background"
android:minHeight="@dimen/osmo_header_height"
android:orientation="horizontal"
android:paddingLeft="@dimen/dashboard_parking_left_margin"
android:paddingRight="@dimen/dashboard_parking_left_margin">
<ImageView
android:id="@+id/osmo_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/mon_osmo_conn_small" />
<ImageView
android:id="@+id/osmo_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/mon_osmo_conn_small"/>
<CheckBox
android:id="@+id/enable_service"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:gravity="center_vertical"
android:text="@string/osmo_start_service" />
</LinearLayout>
<CheckBox
android:id="@+id/enable_service"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:focusable="false"
android:textColor="@color/color_white"
android:text="@string/osmo_start_service"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/osmo_log_off_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp">
<RelativeLayout
android:id="@+id/osmo_log_off_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dashboard_parking_left_margin"
android:layout_marginRight="@dimen/dashboard_parking_left_margin"
android:minHeight="@dimen/osmo_header_height">
<TextView
android:id="@+id/osmo_user_name_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/anonymous_user"
android:textAppearance="?android:attr/textAppearance" />
<TextView
android:id="@+id/osmo_user_name_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/anonymous_user"
android:textAppearance="?android:attr/textAppearance"/>
<CheckBox
android:id="@+id/osmo_login_logoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:focusable="false"
android:gravity="center_vertical" />
<CheckBox
android:id="@+id/osmo_login_logoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:focusable="false"
android:gravity="center_vertical"/>
<Button
android:id="@+id/osmo_login_hint_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/osmo_user_name_text_view"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="\?"
android:textAppearance="?android:attr/textAppearance" />
<Button
android:id="@+id/osmo_login_hint_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/osmo_user_name_text_view"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="\?"
android:textAppearance="?android:attr/textAppearance"/>
</RelativeLayout>
</RelativeLayout>
<CheckBox
android:id="@+id/enable_tracker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp"
android:gravity="center_vertical"
android:text="@string/osmo_enable_tracker" />
<CheckBox
android:id="@+id/enable_tracker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dashboard_parking_left_margin"
android:layout_marginRight="@dimen/dashboard_parking_left_margin"
android:checked="false"
android:focusable="false"
android:gravity="center_vertical"
android:minHeight="@dimen/osmo_header_height"
android:text="@string/osmo_enable_tracker"/>
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dip"
android:autoLink="web"
android:gravity="center"
android:textSize="18sp" />
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:textSize="18sp"/>
</LinearLayout>

View file

@ -37,6 +37,7 @@
<attr name="list_settings_icon" format="reference"/>
<attr name="size_progress_bar" format="reference"/>
<attr name="dash_parking_bg" format="reference"/>
<attr name="osmo_header_background" format="color"/>
</declare-styleable>
<declare-styleable name="PagerSlidingTabStrip">

View file

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="osmo_header_dark">#2d383d</color>
<color name="osmo_header_light">#b36d12</color>
<color name="parking_card_selected">#234DDE</color>
<color name="dashboard_parking_dark_color">#54778c</color>
<color name="dashboard_parking_dark_selected">#446072</color>

View file

@ -49,6 +49,7 @@
<dimen name="dashboard_parking_icon_size">48dp</dimen>
<dimen name="map_button_size">40dp</dimen>
<dimen name="map_button_margin">8dp</dimen>
<dimen name="osmo_header_height">56dp</dimen>
<!-- TextSizes -->

View file

@ -166,6 +166,7 @@
<item name="list_settings_icon">@drawable/ic_overflow_menu_light</item>
<item name="size_progress_bar">@drawable/size_progressbar_light</item>
<item name="dash_parking_bg">@drawable/dash_parking_light</item>
<item name="osmo_header_background">@color/osmo_header_light</item>
</style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
@ -210,6 +211,7 @@
<item name="list_settings_icon">@drawable/ic_overflow_menu_dark</item>
<item name="size_progress_bar">@drawable/size_progressbar_dark</item>
<item name="dash_parking_bg">@drawable/dash_parking_dark</item>
<item name="osmo_header_background">@color/osmo_header_dark</item>
</style>
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">

View file

@ -1,9 +1,12 @@
package net.osmand.plus.activities;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ProgressBar;
import net.osmand.plus.R;
/**
* Created by Denis
* on 23.01.15.
@ -29,4 +32,23 @@ public class ActionBarProgressActivity extends OsmandActionBarActivity {
public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);
}
public Toolbar getClearToolbar(boolean visible) {
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
if (tb == null) {
return null;
}
tb.setTitle(null);
tb.getMenu().clear();
tb.setVisibility(visible? View.VISIBLE : View.GONE);
return tb;
}
public void setToolbarVisibility(boolean visible){
View toolbar = findViewById(R.id.bottomControls);
if (toolbar != null) {
toolbar.setVisibility(visible? View.VISIBLE : View.GONE);
}
}
}

View file

@ -6,7 +6,9 @@ import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ExpandableListView;
import net.osmand.plus.OsmandApplication;
import android.app.ActionBar;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.BitmapDrawable;
@ -17,7 +19,7 @@ import android.view.View;
public abstract class OsmandExpandableListActivity extends
ActionBarProgressActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
@ -27,22 +29,22 @@ public abstract class OsmandExpandableListActivity extends
public OsmandApplication getMyApplication() {
return (OsmandApplication)getApplication();
return (OsmandApplication) getApplication();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
switch (itemId) {
case android.R.id.home:
finish();
return true;
case android.R.id.home:
finish();
return true;
}
return false;
}
public MenuItem createMenuItem(Menu m, int id, int titleRes, int iconLight, int iconDark, int menuItemType) {
int r = isLightActionBar() ? iconLight : iconDark;
MenuItem menuItem = m.add(0, id, 0, titleRes);
@ -58,7 +60,11 @@ public abstract class OsmandExpandableListActivity extends
MenuItemCompat.setShowAsAction(menuItem, menuItemType);
return menuItem;
}
public MenuItem createMenuItem(Menu m, int id, int titleRes, int icon, int menuItemType) {
return createMenuItem(m, id, titleRes, icon, icon, menuItemType);
}
public void fixBackgroundRepeat(View view) {
Drawable bg = view.getBackground();
if (bg != null) {
@ -69,18 +75,18 @@ public abstract class OsmandExpandableListActivity extends
}
}
}
public void setListAdapter(OsmandBaseExpandableListAdapter adapter){
((ExpandableListView)findViewById(android.R.id.list)).setAdapter(adapter);
public void setListAdapter(OsmandBaseExpandableListAdapter adapter) {
((ExpandableListView) findViewById(android.R.id.list)).setAdapter(adapter);
}
public ExpandableListView getExpandableListView() {
return (ExpandableListView)findViewById(android.R.id.list);
return (ExpandableListView) findViewById(android.R.id.list);
}
public void setOnChildClickListener(ExpandableListView.OnChildClickListener childClickListener){
((ExpandableListView)findViewById(android.R.id.list)).setOnChildClickListener(childClickListener);
public void setOnChildClickListener(ExpandableListView.OnChildClickListener childClickListener) {
((ExpandableListView) findViewById(android.R.id.list)).setOnChildClickListener(childClickListener);
}
public boolean isLightActionBar() {

View file

@ -148,10 +148,11 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
}
TextView label = (TextView) row.findViewById(R.id.folder_label);
ImageView icon = (ImageView) row.findViewById(R.id.folder_icon);
OsmandApplication app = getMyApplication();
final PoiLegacyFilter model = getItem(position);
label.setText(model.getName());
if(model.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID)) {
icon.setImageResource(R.drawable.ic_action_filter_dark);
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_filter_dark));
} else if (model.getFilterId().equals(PoiLegacyFilter.BY_NAME_FILTER_ID)) {
icon.setImageResource(android.R.drawable.ic_search_category_default);
} else {
@ -191,4 +192,8 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
public void locationUpdate(LatLon l) {
}
public OsmandApplication getMyApplication() {
return (OsmandApplication) getActivity().getApplication();
}
}

View file

@ -127,18 +127,6 @@ public class FavoritesActivity extends TabActivity {
}
public Toolbar getClearToolbar(boolean visible) {
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
tb.setTitle(null);
tb.getMenu().clear();
tb.setVisibility(visible? View.VISIBLE : View.GONE);
return tb;
}
public void setToolbarVisibility(boolean visible){
findViewById(R.id.bottomControls).setVisibility(visible? View.VISIBLE : View.GONE);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();

View file

@ -38,6 +38,8 @@ import net.osmand.plus.activities.OsmandExpandableListActivity;
import net.osmand.plus.activities.actions.ShareDialog;
import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.helpers.ScreenOrientationHelper;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.osmo.OsMoGroups.OsMoGroupsUIListener;
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoGroup;
@ -78,6 +80,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ExpandableListView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
@ -433,31 +436,31 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
}
if (device != null && device.getLastLocation() != null) {
createMenuItem(menu, SHOW_ON_MAP_ID, R.string.shared_string_show_on_map, R.drawable.ic_action_marker_light, R.drawable.ic_action_marker_dark,
createMenuItem(menu, SHOW_ON_MAP_ID, R.string.shared_string_show_on_map, R.drawable.ic_action_marker_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
}
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_light, R.drawable.ic_action_gshare_dark,
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark,
// there is a bug in Android 4.2 layout
device != null && device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
///
if (device != null) {
createMenuItem(menu, SETTINGS_DEV_ID, R.string.shared_string_settings, R.drawable.ic_action_settings_enabled_light, R.drawable.ic_action_settings_enabled_dark,
createMenuItem(menu, SETTINGS_DEV_ID, R.string.shared_string_settings, R.drawable.ic_action_settings_enabled_dark,
// there is a bug in Android 4.2 layout
device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
}
if (device != null && device.getLastLocation() != null) {
MenuItem menuItem = createMenuItem(menu, TRACK_DEV_ID, R.string.osmo_set_moving_target, R.drawable.ic_action_flage_light, R.drawable.ic_action_flage_dark,
// there is a bug in Android 4.2 layout
MenuItem menuItem = createMenuItem(menu, TRACK_DEV_ID, R.string.osmo_set_moving_target, R.drawable.ic_action_flage_dark,
// there is a bug in Android 4.2 layout
device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
menuItem.setTitleCondensed(getString(R.string.osmo_follow));
}
if (group != null) {
createMenuItem(menu, GROUP_INFO, R.string.osmo_group_info, R.drawable.ic_action_info_light, R.drawable.ic_action_info_dark,
createMenuItem(menu, GROUP_INFO, R.string.osmo_group_info, R.drawable.ic_action_info_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
}
if ((group != null && !group.isMainGroup()) || (device != null && device.getGroup().isMainGroup())) {
createMenuItem(menu, DELETE_ACTION_ID, R.string.shared_string_delete,
R.drawable.ic_action_delete_light, R.drawable.ic_action_delete_dark,
R.drawable.ic_action_delete_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
}
@ -850,7 +853,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
final EditText description = (EditText) v.findViewById(R.id.Description);
final EditText name = (EditText) v.findViewById(R.id.Name);
final CheckBox onlyByInvite = (CheckBox) v.findViewById(R.id.OnlyByInvite);
final TextView warnCreate = (TextView) v.findViewById(R.id.osmo_group_create_info);
final TextView warnCreateDesc = (TextView) v.findViewById(R.id.osmo_group_create_dinfo);
View.OnClickListener click = new View.OnClickListener() {
@ -860,7 +863,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
warnCreateDesc.setVisibility(vls == View.VISIBLE? View.GONE : View.VISIBLE);
}
};
warnCreate.setOnClickListener(click);
ImageButton info = (ImageButton) v.findViewById(R.id.info);
info.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_info_dark));
info.setOnClickListener(click);
warnCreateDesc.setOnClickListener(click);
builder.setView(v);
@ -957,18 +962,26 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.clear();
Menu oldMenu = menu;
boolean portrait = ScreenOrientationHelper.isOrientationPortrait(this);
if (portrait) {
menu = getClearToolbar(true).getMenu();
} else {
getClearToolbar(false);
}
createMenuItem(menu, CONNECT_TO, R.string.osmo_connect,
0, 0,/*R.drawable.ic_action_marker_light,*/
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
createMenuItem(menu, SHARE_SESSION, R.string.osmo_share_session,
R.drawable.ic_action_gshare_dark, R.drawable.ic_action_gshare_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
R.drawable.ic_action_gshare_dark,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
createMenuItem(menu, CREATE_GROUP, R.string.osmo_create_group,
R.drawable.ic_action_plus_dark, R.drawable.ic_action_plus_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
createMenuItem(menu, SETTINGS_ID, R.string.shared_string_settings,
R.drawable.ic_action_settings_enabled_dark, R.drawable.ic_action_settings_enabled_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
R.drawable.ic_group_add,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
createMenuItem(oldMenu, SETTINGS_ID, R.string.shared_string_settings,
R.drawable.ic_action_settings_enabled_dark,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
return super.onCreateOptionsMenu(menu);
}
@ -1152,8 +1165,6 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
final OsMoGroup model = getGroup(groupPosition);
if(selectedObject == model) {
row.setBackgroundColor(getResources().getColor(R.color.row_selection_color));
} else {
row.setBackgroundColor(Color.TRANSPARENT);
}
label.setText(model.getVisibleName(OsMoGroupsActivity.this));
if(model.isMainGroup() || model.isActive()) {
@ -1219,8 +1230,6 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
row.setTag(model);
if(selectedObject == model) {
row.setBackgroundColor(getResources().getColor(R.color.row_selection_color));
} else {
row.setBackgroundColor(Color.TRANSPARENT);
}
TextView label = (TextView) row.findViewById(R.id.osmo_label);
TextView labelTime = (TextView) row.findViewById(R.id.osmo_label_time);