Notes empty bar fix #1625
This commit is contained in:
parent
6531bb3843
commit
680c542223
4 changed files with 38 additions and 46 deletions
|
@ -6,7 +6,7 @@
|
|||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:drawablePadding="24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp"
|
||||
|
|
|
@ -13,25 +13,25 @@ import net.osmand.plus.R;
|
|||
*/
|
||||
public class ActionBarProgressActivity extends OsmandActionBarActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setupIntermediateProgressBar();
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setupIntermediateProgressBar();
|
||||
}
|
||||
|
||||
protected void setupIntermediateProgressBar() {
|
||||
ProgressBar progressBar = new ProgressBar(this);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
progressBar.setIndeterminate(true);
|
||||
getSupportActionBar().setDisplayShowCustomEnabled(true);
|
||||
getSupportActionBar().setCustomView(progressBar);
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
}
|
||||
protected void setupIntermediateProgressBar() {
|
||||
ProgressBar progressBar = new ProgressBar(this);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
progressBar.setIndeterminate(true);
|
||||
getSupportActionBar().setDisplayShowCustomEnabled(true);
|
||||
getSupportActionBar().setCustomView(progressBar);
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
|
||||
getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
@Override
|
||||
public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
|
||||
getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
public Toolbar getClearToolbar(boolean visible) {
|
||||
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
|
||||
|
@ -40,14 +40,14 @@ public class ActionBarProgressActivity extends OsmandActionBarActivity {
|
|||
}
|
||||
tb.setTitle(null);
|
||||
tb.getMenu().clear();
|
||||
tb.setVisibility(visible? View.VISIBLE : View.GONE);
|
||||
tb.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
return tb;
|
||||
}
|
||||
|
||||
public void setToolbarVisibility(boolean visible){
|
||||
public void setToolbarVisibility(boolean visible) {
|
||||
View toolbar = findViewById(R.id.bottomControls);
|
||||
if (toolbar != null) {
|
||||
toolbar.setVisibility(visible? View.VISIBLE : View.GONE);
|
||||
toolbar.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,9 @@ public class NotesFragment extends OsmAndListFragment {
|
|||
items = new ArrayList<Recording>(plugin.getAllRecordings());
|
||||
listAdapter = new NotesAdapter(items);
|
||||
getListView().setAdapter(listAdapter);
|
||||
if (!AndroidUiHelper.isOrientationPortrait(getActivity())) {
|
||||
((ActionBarProgressActivity) getActivity()).getClearToolbar(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -322,11 +325,6 @@ public class NotesFragment extends OsmAndListFragment {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
public OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
|
|
@ -3,20 +3,6 @@
|
|||
*/
|
||||
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.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
|
@ -29,6 +15,20 @@ import android.text.style.ImageSpan;
|
|||
import android.view.MenuItem;
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
|
|
Loading…
Reference in a new issue