-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Mingyueyixi/v1.21/dev
V1.21/dev
- Loading branch information
Showing
12 changed files
with
221 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.lu.wxmask; | ||
|
||
import android.app.Application; | ||
|
||
import androidx.lifecycle.ViewModelStore; | ||
import androidx.lifecycle.ViewModelStoreOwner; | ||
|
||
import com.lu.wxmask.ui.JsonMenuManager; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class App extends Application implements ViewModelStoreOwner { | ||
public static final Companion Companion = new Companion(); | ||
public static App instance; | ||
|
||
public void onCreate() { | ||
super.onCreate(); | ||
Companion.setInstance(this); | ||
JsonMenuManager.Companion.updateMenuListFromRemote(this); | ||
} | ||
|
||
@Override | ||
public ViewModelStore getViewModelStore() { | ||
return new ViewModelStore(); | ||
} | ||
|
||
public static final class Companion { | ||
private Companion() { | ||
} | ||
|
||
public final App getInstance() { | ||
App app = instance; | ||
if (app != null) { | ||
return app; | ||
} | ||
return null; | ||
} | ||
|
||
public final void setInstance(@NotNull App app) { | ||
instance = app; | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.