forked from upstream-mirrors/OpenTracks
Preferences: Import all/Export all has now transparent background and back button works as desired.
This commit is contained in:
@@ -83,7 +83,9 @@ limitations under the License.
|
|||||||
android:name=".AggregatedStatsActivity"
|
android:name=".AggregatedStatsActivity"
|
||||||
android:label="@string/menu_aggregated_statistics" />
|
android:label="@string/menu_aggregated_statistics" />
|
||||||
<activity android:name=".DeleteActivity" />
|
<activity android:name=".DeleteActivity" />
|
||||||
<activity android:name=".io.file.importer.ImportActivity">
|
<activity
|
||||||
|
android:name=".io.file.importer.ImportActivity"
|
||||||
|
android:theme="@style/ThemeCustomTransparent">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.ATTACH_DATA" />
|
<action android:name="android.intent.action.ATTACH_DATA" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
@@ -128,7 +130,9 @@ limitations under the License.
|
|||||||
android:name="android.app.default_searchable"
|
android:name="android.app.default_searchable"
|
||||||
android:value=".SearchListActivity" />
|
android:value=".SearchListActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".io.file.exporter.ExportActivity" />
|
<activity
|
||||||
|
android:name=".io.file.exporter.ExportActivity"
|
||||||
|
android:theme="@style/ThemeCustomTransparent" />
|
||||||
<activity android:name=".settings.RecordingSettingsActivity" />
|
<activity android:name=".settings.RecordingSettingsActivity" />
|
||||||
<activity android:name=".settings.SettingsActivity" />
|
<activity android:name=".settings.SettingsActivity" />
|
||||||
<activity android:name=".settings.StatsSettingsActivity" />
|
<activity android:name=".settings.StatsSettingsActivity" />
|
||||||
|
|||||||
@@ -70,14 +70,35 @@ public class FileTypeDialogFragment extends AbstractDialogFragment {
|
|||||||
choices[i] = getString(optionId, trackFileFormat.name(),
|
choices[i] = getString(optionId, trackFileFormat.name(),
|
||||||
FileUtils.getPathDisplayName(trackFileFormat.getExtension()));
|
FileUtils.getPathDisplayName(trackFileFormat.getExtension()));
|
||||||
}
|
}
|
||||||
return new AlertDialog.Builder(getActivity()).setNegativeButton(R.string.generic_cancel, null)
|
return new AlertDialog.Builder(getActivity())
|
||||||
|
.setCancelable(true)
|
||||||
|
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
onDismissed();
|
||||||
|
}
|
||||||
|
})
|
||||||
.setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
.setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
|
int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
|
||||||
caller.onFileTypeDone(TrackFileFormat.values()[position]);
|
caller.onFileTypeDone(TrackFileFormat.values()[position]);
|
||||||
}
|
}
|
||||||
}).setSingleChoiceItems(choices, 0, null).setTitle(titleId).create();
|
})
|
||||||
|
.setSingleChoiceItems(choices, 0, null)
|
||||||
|
.setTitle(titleId)
|
||||||
|
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialog) {
|
||||||
|
onDismissed();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onDismissed() {
|
||||||
|
dismiss();
|
||||||
|
caller.onDismissed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,5 +112,7 @@ public class FileTypeDialogFragment extends AbstractDialogFragment {
|
|||||||
* Called when file type selection is done.
|
* Called when file type selection is done.
|
||||||
*/
|
*/
|
||||||
void onFileTypeDone(TrackFileFormat trackFileFormat);
|
void onFileTypeDone(TrackFileFormat trackFileFormat);
|
||||||
|
|
||||||
|
void onDismissed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,6 +92,11 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismissed() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
@@ -103,6 +108,7 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
saveAsyncTask.cancel(true);
|
saveAsyncTask.cancel(true);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
onDismissed();
|
||||||
}
|
}
|
||||||
}, directoryDisplayName);
|
}, directoryDisplayName);
|
||||||
return progressDialog;
|
return progressDialog;
|
||||||
@@ -129,13 +135,13 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
@Override
|
@Override
|
||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
finish();
|
onDismissed();
|
||||||
}
|
}
|
||||||
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int arg1) {
|
public void onClick(DialogInterface dialog, int arg1) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
finish();
|
onDismissed();
|
||||||
}
|
}
|
||||||
}).setTitle(titleId);
|
}).setTitle(titleId);
|
||||||
final Dialog dialog = builder.create();
|
final Dialog dialog = builder.create();
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismissed() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
@@ -112,6 +117,7 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
importAsyncTask.cancel(true);
|
importAsyncTask.cancel(true);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
onDismissed();
|
||||||
}
|
}
|
||||||
}, directoryDisplayName);
|
}, directoryDisplayName);
|
||||||
return progressDialog;
|
return progressDialog;
|
||||||
@@ -142,13 +148,13 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
|||||||
@Override
|
@Override
|
||||||
public void onCancel(DialogInterface dialogInterface) {
|
public void onCancel(DialogInterface dialogInterface) {
|
||||||
dialogInterface.dismiss();
|
dialogInterface.dismiss();
|
||||||
finish();
|
onDismissed();
|
||||||
}
|
}
|
||||||
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialogInterface, int which) {
|
public void onClick(DialogInterface dialogInterface, int which) {
|
||||||
dialogInterface.dismiss();
|
dialogInterface.dismiss();
|
||||||
finish();
|
onDismissed();
|
||||||
}
|
}
|
||||||
}).setTitle(titleId).create();
|
}).setTitle(titleId).create();
|
||||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ limitations under the License.
|
|||||||
<item name="android:alertDialogTheme">@style/CustomAlertDialogTheme</item>
|
<item name="android:alertDialogTheme">@style/CustomAlertDialogTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="ThemeCustomTransparent" parent="ThemeCustom">
|
||||||
|
<!-- TODO Remove when moving to settings to fragments. -->
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<item name="android:backgroundDimEnabled">false</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="CustomAlertDialogTheme" parent="@android:style/Theme.Holo.Dialog">
|
<style name="CustomAlertDialogTheme" parent="@android:style/Theme.Holo.Dialog">
|
||||||
<!-- From auto generated -->
|
<!-- From auto generated -->
|
||||||
<item name="android:activatedBackgroundIndicator">@drawable/activated_background_holo_dark
|
<item name="android:activatedBackgroundIndicator">@drawable/activated_background_holo_dark
|
||||||
|
|||||||
Reference in New Issue
Block a user