Layouts updated.

This commit is contained in:
Bars107 2014-12-17 13:13:52 +02:00
parent f3487b1cbe
commit 4a2bdf9b59
6 changed files with 25 additions and 27 deletions

View file

@ -13,23 +13,7 @@
android:layout_height="40dp"> android:layout_height="40dp">
<TextView android:text="@string/map_update" <TextView android:text="@string/map_update"
android:id="@+id/header" android:id="@+id/header"
android:layout_width="wrap_content" style="@style/DashboardSubHeader"/>
android:layout_height="fill_parent"
android:paddingTop="2dp"
android:gravity="center_vertical"
android:layout_marginLeft="15dp"
android:textSize="14sp"
android:textColor="@color/dashboard_black"/>
<ProgressBar android:id="@+id/main_progress"
android:visibility="visible"
android:layout_marginLeft="2dp"
android:indeterminate="true"
android:indeterminateOnly="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<View android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button android:id="@+id/show_all" <Button android:id="@+id/show_all"
android:text="@string/show_all" android:text="@string/show_all"
style="@style/DashboardGeneralButton"/> style="@style/DashboardGeneralButton"/>

View file

@ -10,7 +10,7 @@
android:background="@color/dashboard_divider" android:background="@color/dashboard_divider"
android:layout_height="1dp"/> android:layout_height="1dp"/>
<LinearLayout android:orientation="horizontal" <LinearLayout android:orientation="horizontal"
android:layout_marginLeft="12dp" android:layout_marginLeft="15dp"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" <LinearLayout android:orientation="vertical"

View file

@ -28,36 +28,42 @@
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashSearchFragment" android:name="net.osmand.plus.dashboard.DashSearchFragment"
android:layout_marginTop="4dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashFavoritesFragment" android:name="net.osmand.plus.dashboard.DashFavoritesFragment"
android:layout_width="match_parent" android:layout_marginTop="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashAudioVideoNotesFragment" android:name="net.osmand.plus.dashboard.DashAudioVideoNotesFragment"
android:layout_marginTop="4dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashUpdatesFragment" android:name="net.osmand.plus.dashboard.DashUpdatesFragment"
android:layout_marginTop="4dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashDownloadMapsFragment" android:name="net.osmand.plus.dashboard.DashDownloadMapsFragment"
android:layout_marginTop="4dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<fragment <fragment
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashPluginsFragment" android:name="net.osmand.plus.dashboard.DashPluginsFragment"
android:layout_marginTop="4dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>

View file

@ -12,7 +12,7 @@
<item name="android:layout_width">0dp</item> <item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item> <item name="android:layout_weight">1</item>
<item name="android:layout_height">fill_parent</item> <item name="android:layout_height">fill_parent</item>
<item name="android:paddingTop">2dp</item> <item name="android:paddingBottom">2dp</item>
<item name="android:gravity">center_vertical</item> <item name="android:gravity">center_vertical</item>
<item name="android:textColor">@color/dashboard_black</item> <item name="android:textColor">@color/dashboard_black</item>
<item name="android:layout_marginLeft">15dp</item>ll <item name="android:layout_marginLeft">15dp</item>ll
@ -20,7 +20,7 @@
</style> </style>
<style name="DashboardGeneralButton"> <style name="DashboardGeneralButton">
<item name="android:layout_marginRight">16dp</item> <item name="android:layout_marginRight">14dp</item>
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">36dp</item> <item name="android:layout_height">36dp</item>
<item name="android:layout_gravity">center_vertical</item> <item name="android:layout_gravity">center_vertical</item>

View file

@ -29,9 +29,6 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
if (plugin == null) {
return super.onCreateView(inflater, container, savedInstanceState);
}
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_audio_video_notes_plugin, container, false); View view = getActivity().getLayoutInflater().inflate(R.layout.dash_audio_video_notes_plugin, container, false);
Typeface typeface = FontCache.getRobotoMedium(getActivity()); Typeface typeface = FontCache.getRobotoMedium(getActivity());
@ -51,6 +48,9 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (plugin == null) {
plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
}
setupNotes(); setupNotes();
} }
@ -61,6 +61,10 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
public void setupNotes() { public void setupNotes() {
View mainView = getView(); View mainView = getView();
if (plugin == null){
(mainView.findViewById(R.id.main_notes)).setVisibility(View.GONE);
return;
}
List<AudioVideoNotesPlugin.Recording> notes = new ArrayList<AudioVideoNotesPlugin.Recording>(plugin.getAllRecordings()); List<AudioVideoNotesPlugin.Recording> notes = new ArrayList<AudioVideoNotesPlugin.Recording>(plugin.getAllRecordings());
if (notes.size() == 0){ if (notes.size() == 0){

View file

@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import android.graphics.Typeface;
import android.media.Image; import android.media.Image;
import android.widget.*; import android.widget.*;
import net.osmand.plus.R; import net.osmand.plus.R;
@ -19,6 +20,7 @@ import android.support.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import net.osmand.plus.helpers.FontCache;
/** /**
* Created by Denis on 21.11.2014. * Created by Denis on 21.11.2014.
@ -37,7 +39,11 @@ public class DashUpdatesFragment extends DashBaseFragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_updates_fragment, container, false); View view = getActivity().getLayoutInflater().inflate(R.layout.dash_updates_fragment, container, false);
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() { Typeface typeface = FontCache.getRobotoMedium(getActivity());
((TextView) view.findViewById(R.id.header)).setTypeface(typeface);
Button showAll = (Button) view.findViewById(R.id.show_all);
showAll.setTypeface(typeface);
showAll.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
final Intent intent = new Intent(view.getContext(), getMyApplication().getAppCustomization().getDownloadIndexActivity()); final Intent intent = new Intent(view.getContext(), getMyApplication().getAppCustomization().getDownloadIndexActivity());
@ -81,7 +87,6 @@ public class DashUpdatesFragment extends DashBaseFragment {
progressBars.clear(); progressBars.clear();
baseNames.clear(); baseNames.clear();
downloadButtons.clear(); downloadButtons.clear();
mainView.findViewById(R.id.main_progress).setVisibility(View.GONE);
((TextView) mainView.findViewById(R.id.header)).setText(getString(R.string.map_update ,String.valueOf(list.size()))); ((TextView) mainView.findViewById(R.id.header)).setText(getString(R.string.map_update ,String.valueOf(list.size())));
LinearLayout updates = (LinearLayout) mainView.findViewById(R.id.updates_items); LinearLayout updates = (LinearLayout) mainView.findViewById(R.id.updates_items);
@ -161,7 +166,6 @@ public class DashUpdatesFragment extends DashBaseFragment {
}); });
boolean intermediate = basicProgressAsyncTask.isIndeterminate(); boolean intermediate = basicProgressAsyncTask.isIndeterminate();
currentProgress.setVisibility(intermediate ? View.GONE : View.VISIBLE); currentProgress.setVisibility(intermediate ? View.GONE : View.VISIBLE);
//getView().findViewById(R.id.main_progress).setVisibility(intermediate ? View.VISIBLE : View.GONE);
if (!intermediate) { if (!intermediate) {
currentProgress.setProgress(basicProgressAsyncTask.getProgressPercentage()); currentProgress.setProgress(basicProgressAsyncTask.getProgressPercentage());
} }