Notes empty bar fix #1625

This commit is contained in:
GaidamakUA 2015-09-02 10:34:31 +03:00
parent 6531bb3843
commit 680c542223
4 changed files with 38 additions and 46 deletions

View file

@ -6,7 +6,7 @@
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="16dp" android:padding="16dp"

View file

@ -13,25 +13,25 @@ import net.osmand.plus.R;
*/ */
public class ActionBarProgressActivity extends OsmandActionBarActivity { public class ActionBarProgressActivity extends OsmandActionBarActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setupIntermediateProgressBar(); setupIntermediateProgressBar();
} }
protected void setupIntermediateProgressBar() { protected void setupIntermediateProgressBar() {
ProgressBar progressBar = new ProgressBar(this); ProgressBar progressBar = new ProgressBar(this);
progressBar.setVisibility(View.GONE); progressBar.setVisibility(View.GONE);
progressBar.setIndeterminate(true); progressBar.setIndeterminate(true);
getSupportActionBar().setDisplayShowCustomEnabled(true); getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(progressBar); getSupportActionBar().setCustomView(progressBar);
setSupportProgressBarIndeterminateVisibility(false); setSupportProgressBarIndeterminateVisibility(false);
} }
@Override @Override
public void setSupportProgressBarIndeterminateVisibility(boolean visible) { public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE); getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);
} }
public Toolbar getClearToolbar(boolean visible) { public Toolbar getClearToolbar(boolean visible) {
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls); final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
@ -40,14 +40,14 @@ public class ActionBarProgressActivity extends OsmandActionBarActivity {
} }
tb.setTitle(null); tb.setTitle(null);
tb.getMenu().clear(); tb.getMenu().clear();
tb.setVisibility(visible? View.VISIBLE : View.GONE); tb.setVisibility(visible ? View.VISIBLE : View.GONE);
return tb; return tb;
} }
public void setToolbarVisibility(boolean visible){ public void setToolbarVisibility(boolean visible) {
View toolbar = findViewById(R.id.bottomControls); View toolbar = findViewById(R.id.bottomControls);
if (toolbar != null) { if (toolbar != null) {
toolbar.setVisibility(visible? View.VISIBLE : View.GONE); toolbar.setVisibility(visible ? View.VISIBLE : View.GONE);
} }
} }
} }

View file

@ -113,6 +113,9 @@ public class NotesFragment extends OsmAndListFragment {
items = new ArrayList<Recording>(plugin.getAllRecordings()); items = new ArrayList<Recording>(plugin.getAllRecordings());
listAdapter = new NotesAdapter(items); listAdapter = new NotesAdapter(items);
getListView().setAdapter(listAdapter); getListView().setAdapter(listAdapter);
if (!AndroidUiHelper.isOrientationPortrait(getActivity())) {
((ActionBarProgressActivity) getActivity()).getClearToolbar(false);
}
} }
@Override @Override
@ -322,11 +325,6 @@ public class NotesFragment extends OsmAndListFragment {
}); });
} }
@Override
public void onPause() {
super.onPause();
}
public OsmandApplication getMyApplication() { public OsmandApplication getMyApplication() {
return (OsmandApplication) getActivity().getApplication(); return (OsmandApplication) getActivity().getApplication();
} }

View file

@ -3,20 +3,6 @@
*/ */
package net.osmand.plus.myplaces; package net.osmand.plus.myplaces;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.FavoritesTreeFragment;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import android.app.Activity; import android.app.Activity;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
@ -29,6 +15,20 @@ import android.text.style.ImageSpan;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ImageView; import android.widget.ImageView;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.FavoritesTreeFragment;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
*/ */
@ -119,12 +119,6 @@ public class FavoritesActivity extends TabActivity {
return getMyApplication().getLocationProvider(); return getMyApplication().getLocationProvider();
} }
@Override
protected void onPause() {
super.onPause();
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId(); int itemId = item.getItemId();