Skip to content

Commit

Permalink
Remove MainActivity and use activity-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Sep 24, 2016
1 parent 132dce8 commit 4e952dd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 44 deletions.
30 changes: 21 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,36 @@
android:value="AEdPqrEAAAAI6aeWncbnMNo8E5GWeZ44dlc5cQ7tCROwFhOtiw"/>

<activity
android:name=".activities.habits.list.ListHabitsActivity"
android:exported="true"
android:label="@string/main_activity_title"
android:launchMode="singleTop"/>

<activity-alias
android:name=".MainActivity"
android:label="@string/main_activity_title"
android:launchMode="singleTop">
android:launchMode="singleTop"
android:targetActivity=".activities.habits.list.ListHabitsActivity">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</activity-alias>

<activity
android:name=".activities.habits.show.ShowHabitActivity"
android:label="@string/title_activity_show_habit">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
android:value=".activities.habits.list.ListHabitsActivity"/>
</activity>

<activity
android:name=".activities.settings.SettingsActivity"
android:label="@string/settings">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
android:value=".activities.habits.list.ListHabitsActivity"/>
</activity>

<activity
Expand All @@ -94,7 +100,7 @@
android:label="@string/about">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
android:value=".activities.habits.list.ListHabitsActivity"/>
</activity>

<receiver
Expand Down Expand Up @@ -167,19 +173,25 @@
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="org.isoron.uhabits.ACTION_TOGGLE_REPETITION"/>
<data android:host="org.isoron.uhabits" android:scheme="content"/>
<data
android:host="org.isoron.uhabits"
android:scheme="content"/>
</intent-filter>

<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="org.isoron.uhabits.ACTION_ADD_REPETITION"/>
<data android:host="org.isoron.uhabits" android:scheme="content"/>
<data
android:host="org.isoron.uhabits"
android:scheme="content"/>
</intent-filter>

<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="org.isoron.uhabits.ACTION_REMOVE_REPETITION"/>
<data android:host="org.isoron.uhabits" android:scheme="content"/>
<data
android:host="org.isoron.uhabits"
android:scheme="content"/>
</intent-filter>
</receiver>

Expand Down
34 changes: 0 additions & 34 deletions app/src/main/java/org/isoron/uhabits/MainActivity.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.view.*;

import org.isoron.uhabits.*;
import org.isoron.uhabits.activities.habits.list.*;

import static android.R.anim.*;

Expand Down Expand Up @@ -80,7 +81,7 @@ public boolean onOptionsItemSelected(@Nullable MenuItem item)
public void restartWithFade()
{
new Handler().postDelayed(() -> {
Intent intent = new Intent(this, MainActivity.class);
Intent intent = new Intent(this, ListHabitsActivity.class);
finish();
overridePendingTransition(fade_in, fade_out);
startActivity(intent);
Expand Down

0 comments on commit 4e952dd

Please sign in to comment.