Updated fonts. Updated view.

This commit is contained in:
Denis 2014-11-12 16:49:42 +02:00
parent efde6d74a5
commit fc42493adf
5 changed files with 36 additions and 11 deletions

Binary file not shown.

View file

@ -3,6 +3,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/color_white"
android:layout_marginTop="1dp"
android:layout_height="50dp">
<ImageView android:id="@+id/icon"
android:layout_gravity="center_vertical"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:background="@color/color_white"
android:padding="6dp"
xmlns:android="http://schemas.android.com/apk/res/android">
@ -15,13 +15,15 @@
android:layout_height="wrap_content"
android:background="@drawable/bg_cardui"
android:layout_marginBottom="6dp">
<TextView android:text="@string/search_for"
<TextView android:id="@+id/search_for"
android:text="@string/search_for"
style="@style/DashboardSubHeader"
android:gravity="center_vertical"
android:layout_height="40dp"
android:layout_width="wrap_content"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:background="@color/group_background"
android:background="@color/dashboard_divider"
android:layout_height="90dp">
<Button android:id="@+id/poi"
android:text="@string/poi"
@ -42,7 +44,7 @@
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:background="@color/group_background"
android:background="@color/dashboard_divider"
android:layout_height="90dp">
<Button android:id="@+id/fav"
android:text="@string/my_favorites"
@ -71,7 +73,8 @@
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dp">
<TextView android:text="@string/map_Button"
<TextView android:id="@+id/map_text"
android:text="@string/map_Button"
style="@style/DashboardSubHeader"/>
<Button android:id="@+id/show_map"
android:text="@string/show_map"
@ -81,27 +84,32 @@
<net.osmand.plus.views.OsmAndMapSurfaceView
android:id="@+id/MapView"
android:layout_width="fill_parent"
android:layout_height="160dp"
android:layout_height="110dp"
android:contentDescription="@string/map_view"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout android:id="@+id/favorites"
android:background="@drawable/bg_cardui"
<LinearLayout android:background="@drawable/bg_cardui"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dp">
<TextView android:text="@string/my_data_Button"
<TextView android:id="@+id/fav_text"
android:text="@string/my_data_Button"
style="@style/DashboardSubHeader"/>
<Button android:id="@+id/show_all"
android:text="@string/show_all"
style="@style/DashboardGeneralButton"/>
</LinearLayout>
</LinearLayout>
<LinearLayout android:id="@+id/favorites"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/dashboard_divider"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dashboard_divider">#f0f0f0</color>
<color name="dashboard_black">#212121</color>
<color name="dashboard_blue">#536DFE</color>
<color name="gpx_color_point">#cd2c33</color>

View file

@ -9,6 +9,7 @@ import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -45,7 +46,16 @@ public class DashboardActivity extends SherlockFragmentActivity {
setupMapView();
setupButtons();
setupFavorites();
setupFonts();
}
private void setupFonts() {
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf");
((TextView) findViewById(R.id.search_for)).setTypeface(typeface);
((TextView) findViewById(R.id.map_text)).setTypeface(typeface);
((TextView) findViewById(R.id.fav_text)).setTypeface(typeface);
((Button) findViewById(R.id.show_map)).setTypeface(typeface);
((Button) findViewById(R.id.show_all)).setTypeface(typeface);
}
private void setupFavorites(){
@ -64,7 +74,6 @@ public class DashboardActivity extends SherlockFragmentActivity {
TextView label = (TextView) view.findViewById(R.id.distance);
ImageView icon = (ImageView) view.findViewById(R.id.icon);
final FavouritePoint model = points.get(i);
view.setTag(model);
name.setText(model.getName());
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(DashboardActivity.this, model.getColor()));
LatLon lastKnownMapLocation = getMyApplication().getSettings().getLastKnownMapLocation();
@ -82,6 +91,11 @@ public class DashboardActivity extends SherlockFragmentActivity {
startActivityForResult(mapIndent, 0);
}
});
int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics());
int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics());
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
lp.setMargins(0, margin, 0, 0);
view.setLayoutParams(lp);
favorites.addView(view);
}
}