Fix crash & icons
This commit is contained in:
parent
8e2eb94624
commit
bc48e093f2
4 changed files with 30 additions and 32 deletions
|
@ -241,16 +241,11 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
||||||
return lv;
|
return lv;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectAll(){
|
private void selectAll() {
|
||||||
AmenityAdapter adapter = getListAdapter();
|
AmenityAdapter adapter = getListAdapter();
|
||||||
int count = adapter.getCount();
|
int count = adapter.getCount();
|
||||||
for (int i =0; i< count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
selectAllFromCategory(adapter.getItem(i));
|
selectAllFromCategory(adapter.getItem(i));
|
||||||
ListView lv = EditPOIFilterActivity.this.getListView();
|
|
||||||
final int index = lv.getFirstVisiblePosition();
|
|
||||||
View v = lv.getChildAt(0);
|
|
||||||
final int top = (v == null) ? 0 : v.getTop();
|
|
||||||
lv.setSelectionFromTop(index, top);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,8 +255,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
||||||
for (int i =0; i< count; i++) {
|
for (int i =0; i< count; i++) {
|
||||||
filter.setTypeToAccept(adapter.getItem(i), false);
|
filter.setTypeToAccept(adapter.getItem(i), false);
|
||||||
}
|
}
|
||||||
ListView lv = EditPOIFilterActivity.this.getListView();
|
adapter.notifyDataSetChanged();
|
||||||
lv.deferNotifyDataSetChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -142,15 +142,6 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addErrorFragment() {
|
|
||||||
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
|
|
||||||
android.support.v4.app.FragmentTransaction fragmentTransaction = manager.beginTransaction();
|
|
||||||
if (manager.findFragmentByTag(DashErrorFragment.TAG) == null) {
|
|
||||||
DashErrorFragment errorFragment = new DashErrorFragment();
|
|
||||||
fragmentTransaction.add(R.id.content, errorFragment, DashErrorFragment.TAG).commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void startMapActivity() {
|
private void startMapActivity() {
|
||||||
final Intent mapIndent = new Intent(this, getMyApplication().getAppCustomization().getMapActivity());
|
final Intent mapIndent = new Intent(this, getMyApplication().getAppCustomization().getMapActivity());
|
||||||
|
|
|
@ -76,6 +76,7 @@ import android.widget.Filter;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -479,7 +480,12 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
}
|
}
|
||||||
if (handled) {
|
if (handled) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
amenityAdapter.notifyDataSetChanged();
|
amenityAdapter.notifyDataSetInvalidated();
|
||||||
|
ListView lv = getListView();
|
||||||
|
final int index = lv.getFirstVisiblePosition();
|
||||||
|
View v = lv.getChildAt(0);
|
||||||
|
final int top = (v == null) ? 0 : v.getTop();
|
||||||
|
lv.setSelectionFromTop(index, top);
|
||||||
updateButtonState();
|
updateButtonState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,7 +637,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
amenityAdapter.setNewModel(result);
|
amenityAdapter.setNewModel(result);
|
||||||
|
if(showOnMapItem != null) {
|
||||||
showOnMapItem.setEnabled(amenityAdapter.getCount() > 0);
|
showOnMapItem.setEnabled(amenityAdapter.getCount() > 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
amenityAdapter.setNewModel(result);
|
amenityAdapter.setNewModel(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,21 +140,19 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
* creates (if it wasn't created previously) the control to be added on a MapInfoLayer that shows a monitoring state (recorded/stopped)
|
* creates (if it wasn't created previously) the control to be added on a MapInfoLayer that shows a monitoring state (recorded/stopped)
|
||||||
*/
|
*/
|
||||||
private TextInfoWidget createMonitoringControl(final MapActivity map) {
|
private TextInfoWidget createMonitoringControl(final MapActivity map) {
|
||||||
final Drawable monitoringBig = map.getResources().getDrawable(R.drawable.monitoring_rec_big);
|
|
||||||
final Drawable monitoringSmall = map.getResources().getDrawable(R.drawable.monitoring_rec_small);
|
|
||||||
final Drawable monitoringInactive = map.getResources().getDrawable(R.drawable.monitoring_rec_inactive);
|
|
||||||
monitoringControl = new TextInfoWidget(map) {
|
monitoringControl = new TextInfoWidget(map) {
|
||||||
long lastUpdateTime;
|
long lastUpdateTime;
|
||||||
@Override
|
@Override
|
||||||
public boolean updateInfo(DrawSettings drawSettings) {
|
public boolean updateInfo(DrawSettings drawSettings) {
|
||||||
if(isSaving){
|
if(isSaving){
|
||||||
setText(map.getString(R.string.shared_string_save), "");
|
setText(map.getString(R.string.shared_string_save), "");
|
||||||
setImageDrawable(monitoringBig);
|
setIcons(R.drawable.widget_monitoring_rec_big_day, R.drawable.widget_monitoring_rec_big_night);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String txt = map.getString(R.string.monitoring_control_start);
|
String txt = map.getString(R.string.monitoring_control_start);
|
||||||
String subtxt = null;
|
String subtxt = null;
|
||||||
Drawable d = monitoringInactive;
|
int dn = R.drawable.widget_monitoring_rec_inactive_night;
|
||||||
|
int d = R.drawable.widget_monitoring_rec_inactive_day;
|
||||||
long last = lastUpdateTime;
|
long last = lastUpdateTime;
|
||||||
final boolean globalRecord = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
final boolean globalRecord = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
||||||
final boolean isRecording = app.getSavingTrackHelper().getIsRecording();
|
final boolean isRecording = app.getSavingTrackHelper().getIsRecording();
|
||||||
|
@ -175,27 +173,34 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
|
|
||||||
if(globalRecord) {
|
if(globalRecord) {
|
||||||
//indicates global recording (+background recording)
|
//indicates global recording (+background recording)
|
||||||
d = monitoringBig;
|
dn = R.drawable.widget_monitoring_rec_big_night;
|
||||||
|
d = R.drawable.widget_monitoring_rec_big_day;
|
||||||
} else if (isRecording) {
|
} else if (isRecording) {
|
||||||
//indicates (profile-based, configured in settings) recording (looks like is only active during nav in follow mode)
|
//indicates (profile-based, configured in settings) recording (looks like is only active during nav in follow mode)
|
||||||
d = monitoringSmall;
|
dn = R.drawable.widget_monitoring_rec_small_night;
|
||||||
|
d = R.drawable.widget_monitoring_rec_small_day;
|
||||||
} else {
|
} else {
|
||||||
d = monitoringInactive;
|
dn = R.drawable.widget_monitoring_rec_inactive_night;
|
||||||
|
d = R.drawable.widget_monitoring_rec_inactive_day;
|
||||||
}
|
}
|
||||||
|
|
||||||
setText(txt, subtxt);
|
setText(txt, subtxt);
|
||||||
setImageDrawable(d);
|
setIcons(d, dn);
|
||||||
if ((last != lastUpdateTime) && (globalRecord || isRecording)) {
|
if ((last != lastUpdateTime) && (globalRecord || isRecording)) {
|
||||||
lastUpdateTime = last;
|
lastUpdateTime = last;
|
||||||
//blink implementation with 2 indicator states (global logging + profile/navigation logging)
|
//blink implementation with 2 indicator states (global logging + profile/navigation logging)
|
||||||
setImageDrawable(monitoringInactive);
|
setIcons(R.drawable.widget_monitoring_rec_inactive_day,
|
||||||
|
R.drawable.widget_monitoring_rec_inactive_night);
|
||||||
|
|
||||||
map.getMyApplication().runInUIThread(new Runnable() {
|
map.getMyApplication().runInUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (globalRecord) {
|
if (globalRecord) {
|
||||||
setImageDrawable(monitoringBig);
|
setIcons(R.drawable.widget_monitoring_rec_big_day,
|
||||||
|
R.drawable.widget_monitoring_rec_big_night);
|
||||||
} else {
|
} else {
|
||||||
setImageDrawable(monitoringSmall);
|
setIcons(R.drawable.widget_monitoring_rec_small_day,
|
||||||
|
R.drawable.widget_monitoring_rec_small_night);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
Loading…
Reference in a new issue