Merge pull request #1008 from Bars107/master

Layouts updated.
This commit is contained in:
Denis 2014-12-17 14:25:12 +02:00
commit 5e5082db60
6 changed files with 25 additions and 27 deletions

View file

@ -13,23 +13,7 @@
android:layout_height="40dp">
<TextView android:text="@string/map_update"
android:id="@+id/header"
android:layout_width="wrap_content"
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"/>
style="@style/DashboardSubHeader"/>
<Button android:id="@+id/show_all"
android:text="@string/show_all"
style="@style/DashboardGeneralButton"/>

View file

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

View file

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

View file

@ -12,7 +12,7 @@
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</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:textColor">@color/dashboard_black</item>
<item name="android:layout_marginLeft">15dp</item>ll
@ -20,7 +20,7 @@
</style>
<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_height">36dp</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) {
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);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
@ -51,6 +48,9 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
@Override
public void onResume() {
super.onResume();
if (plugin == null) {
plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
}
setupNotes();
}
@ -61,6 +61,10 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
public void setupNotes() {
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());
if (notes.size() == 0){

View file

@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import android.graphics.Typeface;
import android.media.Image;
import android.widget.*;
import net.osmand.plus.R;
@ -19,6 +20,7 @@ import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import net.osmand.plus.helpers.FontCache;
/**
* Created by Denis on 21.11.2014.
@ -37,7 +39,11 @@ public class DashUpdatesFragment extends DashBaseFragment {
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
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
public void onClick(View view) {
final Intent intent = new Intent(view.getContext(), getMyApplication().getAppCustomization().getDownloadIndexActivity());
@ -81,7 +87,6 @@ public class DashUpdatesFragment extends DashBaseFragment {
progressBars.clear();
baseNames.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())));
LinearLayout updates = (LinearLayout) mainView.findViewById(R.id.updates_items);
@ -161,7 +166,6 @@ public class DashUpdatesFragment extends DashBaseFragment {
});
boolean intermediate = basicProgressAsyncTask.isIndeterminate();
currentProgress.setVisibility(intermediate ? View.GONE : View.VISIBLE);
//getView().findViewById(R.id.main_progress).setVisibility(intermediate ? View.VISIBLE : View.GONE);
if (!intermediate) {
currentProgress.setProgress(basicProgressAsyncTask.getProgressPercentage());
}