commit
4ca1098196
15 changed files with 166 additions and 81 deletions
|
@ -128,6 +128,7 @@
|
||||||
<activity android:name="net.osmand.plus.monitoring.SettingsMonitoringActivity" android:configChanges="keyboardHidden|orientation" />
|
<activity android:name="net.osmand.plus.monitoring.SettingsMonitoringActivity" android:configChanges="keyboardHidden|orientation" />
|
||||||
<activity android:name="net.osmand.plus.rastermaps.SettingsRasterMapsActivity" android:configChanges="keyboardHidden|orientation" />
|
<activity android:name="net.osmand.plus.rastermaps.SettingsRasterMapsActivity" android:configChanges="keyboardHidden|orientation" />
|
||||||
<activity android:name="net.osmand.plus.routepointsnavigation.RoutePointsActivity" />
|
<activity android:name="net.osmand.plus.routepointsnavigation.RoutePointsActivity" />
|
||||||
|
<activity android:name="net.osmand.plus.dashboard.DashAudioVideoNotesActivity" />
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.osmedit.SettingsOsmEditingActivity" android:configChanges="keyboardHidden|orientation" />
|
<activity android:name="net.osmand.plus.osmedit.SettingsOsmEditingActivity" android:configChanges="keyboardHidden|orientation" />
|
||||||
<activity android:name="net.osmand.plus.development.SettingsDevelopmentActivity" android:configChanges="keyboardHidden|orientation" />
|
<activity android:name="net.osmand.plus.development.SettingsDevelopmentActivity" android:configChanges="keyboardHidden|orientation" />
|
||||||
|
|
BIN
OsmAnd/res/drawable-hdpi/ic_crashlog.png
Normal file
BIN
OsmAnd/res/drawable-hdpi/ic_crashlog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_crashlog.png
Normal file
BIN
OsmAnd/res/drawable-mdpi/ic_crashlog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_crashlog.png
Normal file
BIN
OsmAnd/res/drawable-xhdpi/ic_crashlog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_crashlog.png
Normal file
BIN
OsmAnd/res/drawable-xxhdpi/ic_crashlog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
15
OsmAnd/res/layout/audio_video_notes_all.xml
Normal file
15
OsmAnd/res/layout/audio_video_notes_all.xml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:id="@+id/main_scroll"
|
||||||
|
android:background="@color/dashboard_background" >
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:name="net.osmand.plus.dashboard.DashAudioVideoNotesFragment"
|
||||||
|
android:layout_marginTop="@dimen/dashCardMargin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
|
@ -6,7 +6,8 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout android:orientation="horizontal"
|
<LinearLayout android:id="@+id/header"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="@dimen/dashHeaderHeight">
|
android:layout_height="@dimen/dashHeaderHeight">
|
||||||
<TextView android:id="@+id/notes_text"
|
<TextView android:id="@+id/notes_text"
|
||||||
|
|
|
@ -5,13 +5,24 @@
|
||||||
android:background="@drawable/bg_cardui"
|
android:background="@drawable/bg_cardui"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<TextView android:id="@+id/error_header"
|
<LinearLayout android:orientation="horizontal"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:padding="@dimen/dashFavIconMargin"
|
android:layout_height="wrap_content">
|
||||||
android:layout_width="match_parent"
|
<ImageView android:src="@drawable/ic_crashlog"
|
||||||
android:gravity="center_horizontal"
|
android:layout_marginLeft="@dimen/dashFavIconMargin"
|
||||||
android:textColor="@color/dashboard_black"
|
android:layout_marginRight="@dimen/dashFavIconMargin"
|
||||||
android:layout_gravity="center_horizontal"/>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView android:id="@+id/error_header"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginBottom="@dimen/subHeaderPadding"
|
||||||
|
android:layout_marginTop="@dimen/subHeaderPadding"
|
||||||
|
android:textColor="@color/dashboard_black"
|
||||||
|
android:layout_gravity="center_horizontal"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<View android:layout_width="match_parent"
|
<View android:layout_width="match_parent"
|
||||||
android:background="@color/dashboard_divider"
|
android:background="@color/dashboard_divider"
|
||||||
android:layout_height="1dp"/>
|
android:layout_height="1dp"/>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<RelativeLayout android:layout_width="wrap_content"
|
<RelativeLayout android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="@dimen/subHeaderPadding">
|
android:padding="@dimen/subHeaderPadding">
|
||||||
<LinearLayout android:id="@+id/loading"
|
<LinearLayout android:id="@+id/loading"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="@dimen/dashMapHeight"
|
android:layout_height="@dimen/dashMapHeight"
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/ProgressBar"
|
android:id="@+id/ProgressBar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ProgressMessage"
|
android:id="@+id/ProgressMessage"
|
||||||
|
@ -36,18 +36,18 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="3"
|
android:maxLines="3"
|
||||||
android:text="@string/loading_data"
|
android:text="@string/loading_data"
|
||||||
android:textSize="@dimen/dashProgressTextSize" />
|
android:textSize="@dimen/dashProgressTextSize"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<net.osmand.plus.views.OsmAndMapSurfaceView
|
<ImageView android:id="@+id/map_image"
|
||||||
android:id="@+id/MapView"
|
android:scaleType="centerCrop"
|
||||||
android:layout_width="fill_parent"
|
android:src="@drawable/background"
|
||||||
android:layout_height="@dimen/dashMapHeight"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginLeft="@dimen/dashMapMargin"
|
android:layout_height="@dimen/dashMapHeight"
|
||||||
android:layout_marginRight="@dimen/dashMapMargin"
|
android:layout_marginLeft="@dimen/subHeaderPadding"
|
||||||
android:layout_marginBottom="@dimen/dashMapMargin"
|
android:layout_marginRight="@dimen/subHeaderPadding"
|
||||||
android:contentDescription="@string/map_view"
|
android:layout_marginBottom="@dimen/subHeaderPadding"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -4,7 +4,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="@drawable/dashboard_button"
|
android:background="@drawable/dashboard_button"
|
||||||
android:layout_height="@dimen/dashHeaderHeight">
|
android:layout_height="@dimen/dashListItemHeight">
|
||||||
<View android:layout_width="match_parent"
|
<View android:layout_width="match_parent"
|
||||||
android:background="@color/dashboard_divider"
|
android:background="@color/dashboard_divider"
|
||||||
android:layout_height="1dp"/>
|
android:layout_height="1dp"/>
|
||||||
|
@ -43,9 +43,10 @@
|
||||||
<ImageButton android:id="@+id/play"
|
<ImageButton android:id="@+id/play"
|
||||||
android:src="@drawable/ic_play_light"
|
android:src="@drawable/ic_play_light"
|
||||||
android:background="@drawable/dashboard_button"
|
android:background="@drawable/dashboard_button"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="@dimen/dashFavIconMargin"
|
android:layout_marginLeft="@dimen/dashFavIconMargin"
|
||||||
android:layout_width="@dimen/dashHeaderHeight"
|
android:layout_width="@dimen/dashListItemHeight"
|
||||||
android:layout_height="@dimen/dashHeaderHeight"/>
|
android:layout_height="@dimen/dashListItemHeight"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<dimen name="dashFavIconMargin">12dp</dimen>
|
<dimen name="dashFavIconMargin">12dp</dimen>
|
||||||
<dimen name="dashFavDirectionSize">10dp</dimen>
|
<dimen name="dashFavDirectionSize">10dp</dimen>
|
||||||
<dimen name="dashMapHeight">110dp</dimen>
|
<dimen name="dashMapHeight">110dp</dimen>
|
||||||
<dimen name="dashMapMargin">2dp</dimen>
|
|
||||||
<dimen name="dashNoteIconSize">28dp</dimen>
|
<dimen name="dashNoteIconSize">28dp</dimen>
|
||||||
<dimen name="dashPluginPadding">4dp</dimen>
|
<dimen name="dashPluginPadding">4dp</dimen>
|
||||||
<dimen name="dashPluginMargin">8dp</dimen>
|
<dimen name="dashPluginMargin">8dp</dimen>
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import com.actionbarsherlock.app.ActionBar;
|
||||||
|
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||||
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.activities.MainMenuActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Denis on 23.12.2014.
|
||||||
|
*/
|
||||||
|
public class DashAudioVideoNotesActivity extends SherlockFragmentActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
setContentView(R.layout.audio_video_notes_all);
|
||||||
|
|
||||||
|
ColorDrawable color = new ColorDrawable(getResources().getColor(R.color.actionbar_color));
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setTitle(R.string.audionotes_plugin_name);
|
||||||
|
actionBar.setBackgroundDrawable(color);
|
||||||
|
actionBar.setIcon(android.R.color.transparent);
|
||||||
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
this.finish();
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
@ -11,8 +13,10 @@ import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import net.osmand.plus.OsmAndAppCustomization;
|
||||||
import net.osmand.plus.OsmandPlugin;
|
import net.osmand.plus.OsmandPlugin;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.audionotes.AudioVideoNotesPlugin;
|
import net.osmand.plus.audionotes.AudioVideoNotesPlugin;
|
||||||
import net.osmand.plus.helpers.FontCache;
|
import net.osmand.plus.helpers.FontCache;
|
||||||
|
|
||||||
|
@ -24,23 +28,31 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class DashAudioVideoNotesFragment extends DashBaseFragment {
|
public class DashAudioVideoNotesFragment extends DashBaseFragment {
|
||||||
AudioVideoNotesPlugin plugin;
|
AudioVideoNotesPlugin plugin;
|
||||||
|
boolean allNotes;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
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);
|
||||||
|
|
||||||
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());
|
allNotes = getActivity() instanceof DashAudioVideoNotesActivity;
|
||||||
((TextView) view.findViewById(R.id.notes_text)).setTypeface(typeface);
|
if (allNotes) {
|
||||||
((Button) view.findViewById(R.id.show_all)).setTypeface(typeface);
|
view.findViewById(R.id.header).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
Typeface typeface = FontCache.getRobotoMedium(getActivity());
|
||||||
|
((TextView) view.findViewById(R.id.notes_text)).setTypeface(typeface);
|
||||||
|
((Button) view.findViewById(R.id.show_all)).setTypeface(typeface);
|
||||||
|
|
||||||
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
Activity activity = getActivity();
|
||||||
}
|
final Intent favorites = new Intent(activity, DashAudioVideoNotesActivity.class);
|
||||||
});
|
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||||
|
activity.startActivity(favorites);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +92,7 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
|
||||||
|
|
||||||
LinearLayout notesLayout = (LinearLayout) mainView.findViewById(R.id.notes);
|
LinearLayout notesLayout = (LinearLayout) mainView.findViewById(R.id.notes);
|
||||||
notesLayout.removeAllViews();
|
notesLayout.removeAllViews();
|
||||||
if (notes.size() > 3){
|
if (notes.size() > 3 && !allNotes){
|
||||||
while (notes.size() != 3){
|
while (notes.size() != 3){
|
||||||
notes.remove(3);
|
notes.remove(3);
|
||||||
}
|
}
|
||||||
|
@ -95,6 +107,7 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
|
||||||
((TextView) view.findViewById(R.id.descr)).setText(recording.getDescription(getActivity()));
|
((TextView) view.findViewById(R.id.descr)).setText(recording.getDescription(getActivity()));
|
||||||
} else {
|
} else {
|
||||||
((TextView) view.findViewById(R.id.name)).setText(recording.getDescription(getActivity()));
|
((TextView) view.findViewById(R.id.name)).setText(recording.getDescription(getActivity()));
|
||||||
|
view.findViewById(R.id.descr).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageView icon = (ImageView) view.findViewById(R.id.icon);
|
ImageView icon = (ImageView) view.findViewById(R.id.icon);
|
||||||
|
@ -105,16 +118,27 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
|
||||||
} else {
|
} else {
|
||||||
icon.setImageResource(R.drawable.ic_type_img);
|
icon.setImageResource(R.drawable.ic_type_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
getMyApplication().getSettings().setMapLocationToShow(recording.getLatitude(), recording.getLongitude(), 15, null,
|
||||||
|
recording.name != null ? recording.name : recording.getDescription(getActivity()),
|
||||||
|
recording); //$NON-NLS-1$
|
||||||
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
|
}
|
||||||
|
});
|
||||||
view.findViewById(R.id.play).setOnClickListener(new View.OnClickListener() {
|
view.findViewById(R.id.play).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View v) {
|
||||||
plugin.playRecording(getActivity(), recording);
|
plugin.playRecording(getActivity(), recording);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics());
|
|
||||||
|
|
||||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
|
//int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics());
|
||||||
view.setLayoutParams(lp);
|
|
||||||
|
//LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
|
||||||
|
//view.setLayoutParams(lp);
|
||||||
notesLayout.addView(view);
|
notesLayout.addView(view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.widget.ImageView;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.map.MapTileDownloader.DownloadRequest;
|
import net.osmand.map.MapTileDownloader.DownloadRequest;
|
||||||
import net.osmand.map.MapTileDownloader.IMapDownloaderCallback;
|
import net.osmand.map.MapTileDownloader.IMapDownloaderCallback;
|
||||||
|
@ -28,7 +30,6 @@ import android.widget.TextView;
|
||||||
public class DashMapFragment extends DashBaseFragment implements IMapDownloaderCallback {
|
public class DashMapFragment extends DashBaseFragment implements IMapDownloaderCallback {
|
||||||
|
|
||||||
public static final String TAG = "DASH_MAP_FRAGMENT";
|
public static final String TAG = "DASH_MAP_FRAGMENT";
|
||||||
private OsmandMapTileView osmandMapTileView;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
@ -52,7 +53,7 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloader
|
||||||
Typeface typeface = FontCache.getRobotoMedium(getActivity());
|
Typeface typeface = FontCache.getRobotoMedium(getActivity());
|
||||||
((TextView) view.findViewById(R.id.map_text)).setTypeface(typeface);
|
((TextView) view.findViewById(R.id.map_text)).setTypeface(typeface);
|
||||||
((Button) view.findViewById(R.id.show_map)).setTypeface(typeface);
|
((Button) view.findViewById(R.id.show_map)).setTypeface(typeface);
|
||||||
setupMapView(view);
|
|
||||||
(view.findViewById(R.id.show_map)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.show_map)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -61,48 +62,40 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloader
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
return view;
|
view.findViewById(R.id.map_image).setOnClickListener(new View.OnClickListener() {
|
||||||
}
|
|
||||||
|
|
||||||
private void setupMapView(View view){
|
|
||||||
OsmAndMapSurfaceView surf = (OsmAndMapSurfaceView) view.findViewById(R.id.MapView);
|
|
||||||
surf.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
startMapActivity();
|
startMapActivity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
osmandMapTileView = surf.getMapView();
|
setMapImage(view);
|
||||||
osmandMapTileView.getView().setVisibility(View.VISIBLE);
|
|
||||||
osmandMapTileView.removeAllLayers();
|
return view;
|
||||||
MapVectorLayer mapVectorLayer = new MapVectorLayer(null, true);
|
|
||||||
MapTextLayer mapTextLayer = new MapTextLayer();
|
|
||||||
mapTextLayer.setAlwaysVisible(true);
|
|
||||||
// 5.95 all labels
|
|
||||||
osmandMapTileView.addLayer(mapTextLayer, 5.95f);
|
|
||||||
osmandMapTileView.addLayer(mapVectorLayer, 0.5f);
|
|
||||||
osmandMapTileView.setMainLayer(mapVectorLayer);
|
|
||||||
mapVectorLayer.setVisible(true);
|
|
||||||
osmandMapTileView.setShowMapPosition(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setMapImage(View view) {
|
||||||
|
if (view == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bitmap image = getMyApplication().getResourceManager().getRenderer().getBitmap();
|
||||||
|
ImageView map = (ImageView) view.findViewById(R.id.map_image);
|
||||||
|
if (image != null){
|
||||||
|
map.setImageBitmap(image);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
LatLon lm = getMyApplication().getSettings().getLastKnownMapLocation();
|
setMapImage(getView());
|
||||||
int zm = getMyApplication().getSettings().getLastKnownMapZoom();
|
|
||||||
//Let us not change zoom here, it provides for a smoother transition between the map and the dashboard screens, and provides better recognition of the map fragment
|
|
||||||
//zm = Math.max(zm - 3, 4);
|
|
||||||
osmandMapTileView.setLatLon(lm.getLatitude(), lm.getLongitude());
|
|
||||||
osmandMapTileView.setComplexZoom(zm, osmandMapTileView.getSettingsMapDensity());
|
|
||||||
osmandMapTileView.refreshMap(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
view.findViewById(R.id.MapView).setVisibility(View.GONE);
|
view.findViewById(R.id.map_image).setVisibility(View.GONE);
|
||||||
if(getMyApplication().isApplicationInitializing()) {
|
if(getMyApplication().isApplicationInitializing()) {
|
||||||
getMyApplication().checkApplicationIsBeingInitialized(getActivity(), (TextView) view.findViewById(R.id.ProgressMessage),
|
getMyApplication().checkApplicationIsBeingInitialized(getActivity(), (TextView) view.findViewById(R.id.ProgressMessage),
|
||||||
(ProgressBar) view.findViewById(R.id.ProgressBar), new Runnable() {
|
(ProgressBar) view.findViewById(R.id.ProgressBar), new Runnable() {
|
||||||
|
@ -121,7 +114,7 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloader
|
||||||
MainMenuActivity dashboardActivity =((MainMenuActivity)getSherlockActivity());
|
MainMenuActivity dashboardActivity =((MainMenuActivity)getSherlockActivity());
|
||||||
if (dashboardActivity != null){
|
if (dashboardActivity != null){
|
||||||
dashboardActivity.updateDownloads();
|
dashboardActivity.updateDownloads();
|
||||||
view.findViewById(R.id.MapView).setVisibility(View.VISIBLE);
|
view.findViewById(R.id.map_image).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,11 +123,7 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloader
|
||||||
if(request != null && !request.error && request.fileToSave != null){
|
if(request != null && !request.error && request.fileToSave != null){
|
||||||
ResourceManager mgr = getMyApplication().getResourceManager();
|
ResourceManager mgr = getMyApplication().getResourceManager();
|
||||||
mgr.tileDownloaded(request);
|
mgr.tileDownloaded(request);
|
||||||
|
setMapImage(getView());
|
||||||
}
|
}
|
||||||
if(request == null || !request.error){
|
|
||||||
if(osmandMapTileView != null) {
|
|
||||||
osmandMapTileView.tileDownloaded(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
ExpandableListView listView = (ExpandableListView)view.findViewById(android.R.id.list);
|
ExpandableListView listView = (ExpandableListView)view.findViewById(android.R.id.list);
|
||||||
listAdapter = new LocalIndexesAdapter(getActivity());
|
listAdapter = new LocalIndexesAdapter(getActivity());
|
||||||
listView.setAdapter(listAdapter);
|
listView.setAdapter(listAdapter);
|
||||||
|
expandAllGroups();
|
||||||
setListView(listView);
|
setListView(listView);
|
||||||
//getDownloadActivity().getSupportActionBar().setLogo(R.drawable.tab_download_screen_icon);
|
//getDownloadActivity().getSupportActionBar().setLogo(R.drawable.tab_download_screen_icon);
|
||||||
descriptionText = (TextView) view.findViewById(R.id.DescriptionText);
|
descriptionText = (TextView) view.findViewById(R.id.DescriptionText);
|
||||||
|
@ -261,6 +262,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
listAdapter.addLocalIndexInfo(v);
|
listAdapter.addLocalIndexInfo(v);
|
||||||
}
|
}
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
|
expandAllGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResult(List<LocalIndexInfo> result) {
|
public void setResult(List<LocalIndexInfo> result) {
|
||||||
|
@ -272,6 +274,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
listAdapter.addLocalIndexInfo(v);
|
listAdapter.addLocalIndexInfo(v);
|
||||||
}
|
}
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
|
expandAllGroups();
|
||||||
onPostExecute(result);
|
onPostExecute(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -489,6 +492,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
listAdapter.sortData();
|
listAdapter.sortData();
|
||||||
getExpandableListView().setAdapter(listAdapter);
|
getExpandableListView().setAdapter(listAdapter);
|
||||||
|
expandAllGroups();
|
||||||
}
|
}
|
||||||
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
|
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
|
||||||
//hide action bar from downloadindexfragment
|
//hide action bar from downloadindexfragment
|
||||||
|
@ -577,11 +581,10 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void collapseAllGroups() {
|
private void expandAllGroups() {
|
||||||
for (int i = 0; i < listAdapter.getGroupCount(); i++) {
|
for (int i = 0; i < listAdapter.getGroupCount(); i++) {
|
||||||
getExpandableListView().collapseGroup(i);
|
getExpandableListView().expandGroup(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openSelectionMode(final int actionResId, final int actionIconId,
|
private void openSelectionMode(final int actionResId, final int actionIconId,
|
||||||
|
@ -596,7 +599,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
AccessibleToast.makeText(getDownloadActivity(), getString(R.string.local_index_no_items_to_do, actionButton.toLowerCase()), Toast.LENGTH_SHORT).show();
|
AccessibleToast.makeText(getDownloadActivity(), getString(R.string.local_index_no_items_to_do, actionButton.toLowerCase()), Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collapseAllGroups();
|
expandAllGroups();
|
||||||
|
|
||||||
selectionMode = true;
|
selectionMode = true;
|
||||||
selectedItems.clear();
|
selectedItems.clear();
|
||||||
|
@ -641,7 +644,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
descriptionText.setVisibility(View.VISIBLE);
|
descriptionText.setVisibility(View.VISIBLE);
|
||||||
updateDescriptionTextWithSize();
|
updateDescriptionTextWithSize();
|
||||||
listAdapter.cancelFilter();
|
listAdapter.cancelFilter();
|
||||||
collapseAllGroups();
|
expandAllGroups();
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,7 +1001,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
if (group.isBackupedData()) {
|
if (group.isBackupedData()) {
|
||||||
t.append(" - ").append(getString(R.string.local_indexes_cat_backup));
|
t.append(" - ").append(getString(R.string.local_indexes_cat_backup));
|
||||||
}
|
}
|
||||||
adjustIndicator(groupPosition, isExpanded, v);
|
|
||||||
|
v.findViewById(R.id.explist_indicator).setVisibility(View.GONE);
|
||||||
|
|
||||||
TextView nameView = ((TextView) v.findViewById(R.id.category_name));
|
TextView nameView = ((TextView) v.findViewById(R.id.category_name));
|
||||||
List<LocalIndexInfo> list = data.get(group);
|
List<LocalIndexInfo> list = data.get(group);
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
@ -1027,6 +1032,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
||||||
nameView.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
nameView.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v.setOnClickListener(null);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue