updated view
This commit is contained in:
parent
37ec1ff1ce
commit
6838aae693
4 changed files with 54 additions and 26 deletions
|
@ -13,11 +13,11 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_white"
|
||||
android:layout_marginBottom="8dp">
|
||||
<TextView android:text="@string/tip_search"
|
||||
<TextView android:text="@string/search_for"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/color_black"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textSize="16sp"
|
||||
android:layout_height="30dp"/>
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
|
@ -64,24 +64,6 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/home"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/color_white"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView android:id="@+id/home_img"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_action_home_light"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView android:text="@string/favorite_home_category"
|
||||
style="@style/DashboardSubHeader"/>
|
||||
<Button android:id="@+id/navigation"
|
||||
android:text="@string/tip_navigation"
|
||||
style="@style/DashboardGeneralButton"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:background="@color/color_white"
|
||||
android:layout_marginBottom="8dp"
|
||||
|
@ -90,9 +72,9 @@
|
|||
<LinearLayout android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView android:text="@string/map_Button"
|
||||
<TextView android:text="@string/show_map"
|
||||
style="@style/DashboardSubHeader"/>
|
||||
<Button android:id="@+id/show_on_map"
|
||||
<Button android:id="@+id/show_map"
|
||||
android:text="@string/search_shown_on_map"
|
||||
style="@style/DashboardGeneralButton"/>
|
||||
</LinearLayout>
|
||||
|
@ -112,7 +94,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
<TextView android:text="@string/my_data_Button"
|
||||
style="@style/DashboardSubHeader"/>
|
||||
<Button android:id="@+id/btn_show_all"
|
||||
<Button android:id="@+id/show_all"
|
||||
android:text="@string/show_all"
|
||||
style="@style/DashboardGeneralButton"/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
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="search_for">Search for</string>
|
||||
<string name="show_map">SHOW MAP</string>
|
||||
<string name="show_all">SHOW ALL</string>
|
||||
<string name="coordinates">Coordinates</string>
|
||||
<string name="wake_on_voice">Turn on the screen</string>
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import net.osmand.plus.OsmAndAppCustomization;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.render.MapVectorLayer;
|
||||
import net.osmand.plus.sherpafy.StageFavoritesLayer;
|
||||
|
@ -16,16 +24,43 @@ import net.osmand.plus.views.OsmandMapTileView;
|
|||
* Created by Denis on 05.11.2014.
|
||||
*/
|
||||
public class DashboardActivity extends SherlockFragmentActivity {
|
||||
|
||||
public static final boolean TIPS_AND_TRICKS = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.dashboard);
|
||||
getSupportActionBar().setTitle(R.string.app_version);
|
||||
ColorDrawable color = new ColorDrawable(Color.parseColor("#FF9305"));
|
||||
getSupportActionBar().setBackgroundDrawable(color);
|
||||
getSupportActionBar().setIcon(android.R.color.transparent);
|
||||
prepareMapView();
|
||||
setupButtons();
|
||||
|
||||
}
|
||||
|
||||
private void setupButtons(){
|
||||
final Activity activity = this;
|
||||
final OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
|
||||
|
||||
Button showMap = (Button) findViewById(R.id.show_map);
|
||||
showMap.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
final Intent mapIndent = new Intent(activity, appCustomization.getMapActivity());
|
||||
activity.startActivityForResult(mapIndent, 0);
|
||||
}
|
||||
});
|
||||
|
||||
Button showFavorites = (Button) findViewById(R.id.show_all);
|
||||
showFavorites.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
final Intent favorites = new Intent(activity, appCustomization.getFavoritesActivity());
|
||||
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
activity.startActivity(favorites);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void prepareMapView() {
|
||||
|
@ -42,4 +77,13 @@ public class DashboardActivity extends SherlockFragmentActivity {
|
|||
osmandMapTileView.setMainLayer(mapVectorLayer);
|
||||
mapVectorLayer.setVisible(true);
|
||||
}
|
||||
|
||||
private OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getApplication();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ public class MainMenuActivity extends Activity {
|
|||
favouritesButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final Intent favorites = new Intent(activity, appCustomization.getFavoritesActivity());
|
||||
final Intent favorites = new Intent(activity, DashboardActivity.class);
|
||||
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
activity.startActivity(favorites);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue