add ic_launcher in v4 folders to overwrite robot icon from app compat library which is displayed in some places

fix dark theme background color in some activities by applying theme before base.OnCreate
add missing files to version control
This commit is contained in:
Philipp Crocoll 2015-12-22 13:23:21 +01:00
parent 39555fcdaf
commit 2bfedea38b
34 changed files with 100 additions and 21 deletions

View File

@ -55,8 +55,9 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(bundle);
SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true);
SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetHomeButtonEnabled(true);

View File

@ -78,7 +78,7 @@ namespace keepass2android
public EntryActivity() public EntryActivity()
{ {
_activityDesign = new ActivityDesign(this);
} }
protected PwEntry Entry; protected PwEntry Entry;
@ -102,6 +102,7 @@ namespace keepass2android
private Timer _timer; private Timer _timer;
private PluginActionReceiver _pluginActionReceiver; private PluginActionReceiver _pluginActionReceiver;
private PluginFieldReceiver _pluginFieldReceiver; private PluginFieldReceiver _pluginFieldReceiver;
private ActivityDesign _activityDesign;
protected void SetEntryView() protected void SetEntryView()
@ -309,10 +310,12 @@ namespace keepass2android
!prefs.GetBoolean(GetString(Resource.String.maskpass_key), Resources.GetBoolean(Resource.Boolean.maskpass_default)); !prefs.GetBoolean(GetString(Resource.String.maskpass_key), Resources.GetBoolean(Resource.Boolean.maskpass_default));
RequestWindowFeature(WindowFeatures.IndeterminateProgress); RequestWindowFeature(WindowFeatures.IndeterminateProgress);
_activityDesign.ApplyTheme();
base.OnCreate(savedInstanceState); base.OnCreate(savedInstanceState);
new ActivityDesign(this).ApplyTheme();
SetEntryView(); SetEntryView();
@ -934,6 +937,7 @@ namespace keepass2android
{ {
ClearCache(); ClearCache();
base.OnResume(); base.OnResume();
_activityDesign.ReapplyTheme();
} }
public void ClearCache() public void ClearCache()

View File

@ -200,8 +200,9 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(bundle);
SetContentView(Resource.Layout.filestorage_selection); SetContentView(Resource.Layout.filestorage_selection);

View File

@ -53,8 +53,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) { protected override void OnCreate(Bundle savedInstanceState) {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.generate_password); SetContentView(Resource.Layout.generate_password);
SetResult(KeePass.ExitNormal); SetResult(KeePass.ExitNormal);

View File

@ -218,8 +218,9 @@ namespace keepass2android
} }
protected override void OnCreate(Bundle savedInstanceState) { protected override void OnCreate(Bundle savedInstanceState) {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
Android.Util.Log.Debug("KP2A", "Creating GBA"); Android.Util.Log.Debug("KP2A", "Creating GBA");
AppTask = AppTask.GetTaskInOnCreate(savedInstanceState, Intent); AppTask = AppTask.GetTaskInOnCreate(savedInstanceState, Intent);

View File

@ -91,8 +91,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
//see comment to this in PasswordActivity. //see comment to this in PasswordActivity.
//Note that this activity is affected even though it's finished when the app is closed because it //Note that this activity is affected even though it's finished when the app is closed because it
//seems that the "app launch intent" is re-delivered, so this might end up here. //seems that the "app launch intent" is re-delivered, so this might end up here.

View File

@ -52,8 +52,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean( if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(
GetString(Resource.String.ViewDatabaseSecure_key), true)) GetString(Resource.String.ViewDatabaseSecure_key), true))

View File

@ -41,8 +41,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean( if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(
GetString(Resource.String.ViewDatabaseSecure_key), true)) GetString(Resource.String.ViewDatabaseSecure_key), true))

View File

@ -62,8 +62,9 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(bundle);
Intent i = new Intent(this, typeof (PasswordActivity)); Intent i = new Intent(this, typeof (PasswordActivity));
i.SetAction(Intents.StartWithOtp); i.SetAction(Intents.StartWithOtp);

View File

@ -740,8 +740,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
base.OnCreate(savedInstanceState);
_activityDesign.ApplyTheme(); _activityDesign.ApplyTheme();
base.OnCreate(savedInstanceState);
//use FlagSecure to make sure the last (revealed) character of the master password is not visible in recent apps //use FlagSecure to make sure the last (revealed) character of the master password is not visible in recent apps
if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean( if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(

View File

@ -40,13 +40,16 @@ namespace keepass2android
{ {
private IOConnectionInfo _ioc; private IOConnectionInfo _ioc;
private QuickUnlockBroadcastReceiver _intentReceiver; private QuickUnlockBroadcastReceiver _intentReceiver;
private ActivityDesign _design;
public QuickUnlock() public QuickUnlock()
{ {
_design = new ActivityDesign(this);
} }
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
_design.ApplyTheme();
base.OnCreate(bundle); base.OnCreate(bundle);
//use FlagSecure to make sure the last (revealed) character of the password is not visible in recent apps //use FlagSecure to make sure the last (revealed) character of the password is not visible in recent apps
@ -160,6 +163,7 @@ namespace keepass2android
protected override void OnResume() protected override void OnResume()
{ {
base.OnResume(); base.OnResume();
_design.ReapplyTheme();
CheckIfUnloaded(); CheckIfUnloaded();

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -9,13 +9,13 @@
<item android:state_focused="true"> <item android:state_focused="true">
<shape android:shape="rectangle" > <shape android:shape="rectangle" >
<corners android:radius="2dip" /> <corners android:radius="2dip" />
<solid android:color="?activityBackgroundColor"/> <solid android:color="#fff"/>
</shape> </shape>
</item> </item>
<item > <item >
<shape android:shape="rectangle" > <shape android:shape="rectangle" >
<corners android:radius="2dip" /> <corners android:radius="2dip" />
<solid android:color="?activityBackgroundColor" /> <solid android:color="#fff" />
</shape> </shape>
</item> </item>
</selector> </selector>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image_list_view_row_table_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="6dip"
android:paddingRight="?android:attr/scrollbarSize" >
<TextView
android:id="@+id/image_list_view_row_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingRight="40dip"
android:singleLine="true"
android:textColor="@android:color/black"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RadioButton
android:id="@+id/image_list_view_row_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:checked="false"
android:gravity="right" />
</RelativeLayout>

View File

@ -20,8 +20,7 @@
<resources> <resources>
<color name="bgColorLight">#fff</color> <color name="bgColorLight">#fff</color>
<color name="bgColorDark">#000</color> <color name="bgColorDark">#0000</color>
<color name="bgColor">#000</color>
<color name="appPrimaryColor">#8bc34a</color> <color name="appPrimaryColor">#8bc34a</color>
<color name="appPrimaryDarkColor">#548a2e</color> <color name="appPrimaryDarkColor">#548a2e</color>

View File

@ -27,9 +27,10 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
_design.ApplyTheme();
base.OnCreate(bundle); base.OnCreate(bundle);
_design.ApplyTheme();
Kp2aLog.Log("SelectStorageLocationActivity.OnCreate"); Kp2aLog.Log("SelectStorageLocationActivity.OnCreate");

View File

@ -15,6 +15,8 @@ namespace keepass2android
private readonly string _attributeTheme; private readonly string _attributeTheme;
private bool _secureWindow;
public ActivityDesign(Activity activity) public ActivityDesign(Activity activity)
{ {
_activity = activity; _activity = activity;
@ -24,6 +26,7 @@ namespace keepass2android
x => x is Android.App.ActivityAttribute x => x is Android.App.ActivityAttribute
).Cast<ActivityAttribute>().First(); ).Cast<ActivityAttribute>().First();
_attributeTheme = activityAttr.Theme; _attributeTheme = activityAttr.Theme;
} }
catch (Exception e) catch (Exception e)
{ {
@ -32,6 +35,12 @@ namespace keepass2android
} }
private bool SecureWindowPref()
{
return (PreferenceManager.GetDefaultSharedPreferences(_activity).GetBoolean(
_activity.GetString(Resource.String.ViewDatabaseSecure_key), true));
}
public void ApplyTheme() public void ApplyTheme()
{ {
if (HasThemes()) if (HasThemes())
@ -40,6 +49,7 @@ namespace keepass2android
int newTheme = dark ? DarkTheme : LightTheme; int newTheme = dark ? DarkTheme : LightTheme;
_activity.SetTheme(newTheme); _activity.SetTheme(newTheme);
_currentThemeId = newTheme; _currentThemeId = newTheme;
_secureWindow = SecureWindowPref();
} }
_currentIconSet = PreferenceManager.GetDefaultSharedPreferences(_activity) _currentIconSet = PreferenceManager.GetDefaultSharedPreferences(_activity)
.GetString("IconSetKey", _activity.PackageName); .GetString("IconSetKey", _activity.PackageName);
@ -93,8 +103,16 @@ namespace keepass2android
{ {
Kp2aLog.Log("recreating due to icon set change."); Kp2aLog.Log("recreating due to icon set change.");
_activity.Recreate(); _activity.Recreate();
return;
} }
if (SecureWindowPref() != _secureWindow)
{
Kp2aLog.Log("recreating due to secure window change.");
_activity.Recreate();
return;
}
} }
public bool UseDarkTheme public bool UseDarkTheme

View File

@ -77,8 +77,9 @@ namespace keepass2android
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
base.OnCreate(savedInstanceState);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(savedInstanceState);
Kp2aLog.Log("FileSelect.OnCreate"); Kp2aLog.Log("FileSelect.OnCreate");
Kp2aLog.Log("FileSelect:apptask="+Intent.GetStringExtra("KP2A_APPTASK")); Kp2aLog.Log("FileSelect:apptask="+Intent.GetStringExtra("KP2A_APPTASK"));

View File

@ -35,8 +35,9 @@ namespace keepass2android.fileselect
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle);
_design.ApplyTheme(); _design.ApplyTheme();
base.OnCreate(bundle);
SetContentView(Resource.Layout.file_storage_setup); SetContentView(Resource.Layout.file_storage_setup);

View File

@ -545,9 +545,17 @@
<AndroidResource Include="Resources\drawable-xhdpi\ic_menu_download.png" /> <AndroidResource Include="Resources\drawable-xhdpi\ic_menu_download.png" />
<AndroidResource Include="Resources\drawable-xhdpi\ic_menu_share.png" /> <AndroidResource Include="Resources\drawable-xhdpi\ic_menu_share.png" />
<AndroidResource Include="Resources\drawable-xhdpi\ic_menu_upload.png" /> <AndroidResource Include="Resources\drawable-xhdpi\ic_menu_upload.png" />
<AndroidResource Include="Resources\drawable-mdpi-v4\ic_launcher.png" />
<AndroidResource Include="Resources\drawable-mdpi-v4\ic_launcher_offline.png" />
<AndroidResource Include="Resources\drawable-mdpi-v4\ic_launcher_online.png" />
<AndroidResource Include="Resources\drawable-hdpi-v4\ic_launcher.png" />
<AndroidResource Include="Resources\drawable-hdpi-v4\ic_launcher_offline.png" />
<AndroidResource Include="Resources\drawable-hdpi-v4\ic_launcher_online.png" />
<AndroidResource Include="Resources\drawable-xhdpi-v4\ic_launcher.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AndroidResource Include="Resources\drawable\ic99_blank.png" /> <AndroidResource Include="Resources\drawable\ic99_blank.png" />
<AndroidResource Include="Resources\drawable\ic_launcher.png" />
<AndroidResource Include="Resources\layout\about.xml"> <AndroidResource Include="Resources\layout\about.xml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</AndroidResource> </AndroidResource>
@ -708,6 +716,9 @@
<Folder Include="Resources\drawable-ldpi\" /> <Folder Include="Resources\drawable-ldpi\" />
<Folder Include="Resources\drawable-xxhdpi\" /> <Folder Include="Resources\drawable-xxhdpi\" />
<Folder Include="SupportLib\" /> <Folder Include="SupportLib\" />
<Folder Include="Resources\drawable-mdpi-v4\" />
<Folder Include="Resources\drawable-hdpi-v4\" />
<Folder Include="Resources\drawable-xhdpi-v4\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj"> <ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj">

View File

@ -30,8 +30,9 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle);
new ActivityDesign(this).ApplyTheme(); new ActivityDesign(this).ApplyTheme();
base.OnCreate(bundle);
_pluginPackageName = Intent.GetStringExtra(Strings.ExtraPluginPackage); _pluginPackageName = Intent.GetStringExtra(Strings.ExtraPluginPackage);

View File

@ -18,9 +18,10 @@ namespace keepass2android
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
new ActivityDesign(this).ApplyTheme();
base.OnCreate(bundle); base.OnCreate(bundle);
new ActivityDesign(this).ApplyTheme();
SetContentView(Resource.Layout.plugin_list); SetContentView(Resource.Layout.plugin_list);