Update osmo layout

This commit is contained in:
Victor Shcherb 2015-05-26 01:00:54 +02:00
parent ee69e3f4c6
commit 69e23fd28c
10 changed files with 99 additions and 110 deletions

View file

@ -75,6 +75,7 @@ public class BinaryInspector {
// "-vstats",
// "/Users/victorshcherb/osmand/maps/Netherlands_europe_2.obf"
// "/Users/victorshcherb/osmand/maps/World_basemap_2.obf"
});
} else {
in.inspector(args);

View file

@ -579,7 +579,6 @@ public class MapRenderingTypes {
// creation of only section
protected boolean onlyMap;
protected boolean onlyPoi;
protected boolean lang;
// Needed only for map rules
protected int minzoom;

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Switch xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:textColor="@color/color_white"
android:gravity="center_vertical" />

View file

@ -1,56 +0,0 @@
<?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="vertical">
<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"/>
<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>
<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="@dimen/default_desc_text_size"/>
</LinearLayout>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:textColor="@color/color_white"
android:gravity="center_vertical" />

View file

@ -1,56 +1,77 @@
<?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:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/osmo_header_background"
android:orientation="vertical"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding" >
<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">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/list_header_height"
android:orientation="horizontal" >
<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:layout_marginLeft="4dp"
android:layout_marginRight="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:layout_gravity="center_vertical"
android:focusable="false"
android:textColor="@color/color_white"
android:text="@string/osmo_start_service"/>
</LinearLayout>
<include
android:id="@+id/enable_service"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
layout="@layout/check_item"
android:focusable="false"
android:text="@string/osmo_start_service"
android:textColor="@color/color_white" />
</LinearLayout>
<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"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/list_item_height"
android:id="@+id/share_my_location_layout"
android:orientation="horizontal" >
<ImageView
android:id="@+id/share_my_location"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/ic_action_gshare_dark" />
<include
layout="@layout/check_item"
android:id="@+id/enable_tracker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:checked="false"
android:focusable="false"
android:layout_gravity="center_vertical"
android:text="@string/osmo_enable_tracker"
/>
</LinearLayout>
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:textColor="@color/color_white"
android:textSize="@dimen/default_desc_text_size"
android:visibility="gone" />
<TextView
android:id="@+id/motd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:textSize="@dimen/default_list_text_size"/>
</LinearLayout>

View file

@ -49,7 +49,6 @@
<dimen name="dashboard_parking_left_margin">16dp</dimen>
<dimen name="dashboard_parking_icon_size">48dp</dimen>
<dimen name="osmo_header_height">56dp</dimen>
<!-- map buttons -->
<dimen name="map_trans_seek_size">80dp</dimen>
<dimen name="map_route_buttons_width">60dp</dimen>

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="osmo_share_my_location">Share my location</string>
<string name="shared_string_logoff">Log Off</string>
<string name="rendering_attr_hideHouseNumbers_name">Hide house numbers</string>
<string name="application_dir_change_warning3">Do you want OsmAnd to also copy its data files to the new destination?</string>

View file

@ -85,7 +85,6 @@ import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
@ -204,7 +203,16 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
private void setupHeader() {
header = getLayoutInflater().inflate(R.layout.osmo_groups_list_header, null);
getExpandableListView().addHeaderView(header);
ImageView iv = (ImageView) header.findViewById(R.id.share_my_location);
iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
shareSession();
}
});
CompoundButton trackr = (CompoundButton) header.findViewById(R.id.enable_tracker);
trackr.setText(R.string.osmo_share_my_location);
if(osMoPlugin != null && osMoPlugin.getTracker() != null){
trackr.setChecked(osMoPlugin.getTracker().isEnabledTracker());
}
@ -233,6 +241,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
CompoundButton srvc = (CompoundButton) header.findViewById(R.id.enable_service);
srvc.setChecked(osMoPlugin.getService().isEnabled());
srvc.setText(R.string.osmo_start_service);
srvc.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
@ -271,7 +280,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
TextView mtd = (TextView) header.findViewById(R.id.motd);
SessionInfo si = osMoPlugin.getService().getCurrentSessionInfo();
boolean visible = si != null && si.motd != null && si.motd.length() > 0;
mtd.setVisibility(visible? View.VISIBLE:View.GONE);
mtd.setVisibility(visible ? View.VISIBLE : View.GONE);
if(visible) {
mtd.setText(si.motd);
mtd.setLinksClickable(true);
@ -330,7 +339,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
supportInvalidateOptionsMenu();
if(service.isConnected()) {
header.findViewById(R.id.motd).setVisibility(View.VISIBLE);
header.findViewById(R.id.enable_tracker).setVisibility(View.VISIBLE);
header.findViewById(R.id.share_my_location_layout).setVisibility(View.VISIBLE);
header.findViewById(R.id.share_my_location).setVisibility(tracker.isEnabledTracker() ? View.VISIBLE : View.GONE);
if (service.isLoggedIn()) {
getSupportActionBar().setTitle(app.getSettings().OSMO_USER_NAME.get());
} else {
@ -338,7 +348,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
}
} else {
header.findViewById(R.id.motd).setVisibility(View.GONE);
header.findViewById(R.id.enable_tracker).setVisibility(View.GONE);
header.findViewById(R.id.share_my_location_layout).setVisibility(View.GONE);
getSupportActionBar().setTitle(R.string.osmo);
}
}

View file

@ -83,6 +83,6 @@
<!-- Dialog button bar height -->
<dimen name="abc_alert_dialog_button_bar_height">48dp</dimen>
<dimen name="checkbox_padding">12dp</dimen>
<dimen name="checkbox_padding">24dp</dimen>
<dimen name="radio_padding">30dp</dimen>
</resources>