Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Commit

Permalink
1. Fix ViewModel
Browse files Browse the repository at this point in the history
Signed-off-by: Gikode <[email protected]>
  • Loading branch information
AugustToko committed Oct 10, 2019
1 parent 1e4419d commit cc27191
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ android {
renderscriptTargetApi 29
vectorDrawables.useSupportLibrary = true
applicationId 'top.geek_studio.chenlongcould.musicplayer'
versionCode 169
versionName '1.4.9.3'
versionCode 170
versionName '1.4.9.4'
multiDexEnabled = true
multiDexKeepFile file('multidex-config.txt')
applicationIdSuffix = 'Common'
Expand Down
1 change: 1 addition & 0 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":170,"versionName":"1.4.9.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.appcompat.widget.Toolbar;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.transition.Fade;

Expand All @@ -37,6 +38,7 @@
import butterknife.Unbinder;
import top.geek_studio.chenlongcould.musicplayer.adapter.song.NetSearchSongAdapter;
import top.geek_studio.chenlongcould.musicplayer.interfaces.TransDataCallback;
import top.geek_studio.chenlongcould.musicplayer.model.DataViewModel;
import top.geek_studio.chenlongcould.musicplayer.model.NetSearchSong;
import top.geek_studio.chenlongcould.musicplayer.threadPool.CustomThreadPool;
import top.geek_studio.chenlongcould.musicplayer.ui.fragments.mainactivity.AbsMainActivityFragment;
Expand Down Expand Up @@ -78,6 +80,8 @@ public class NetSearchFragment extends AbsMainActivityFragment {
@BindView(R.id.toolbar)
Toolbar toolbar;

private DataViewModel dataViewModel;

public static NetSearchFragment newInstance() {
return new NetSearchFragment();
}
Expand Down Expand Up @@ -122,6 +126,12 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
// ...
}

@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
dataViewModel = ViewModelProviders.of(getMainActivity()).get(DataViewModel.class);
}

private synchronized void initPlayer() {
mediaPlayer = new MediaPlayer();
mediaPlayer.setOnErrorListener((mp, what, extra) -> {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/menu_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:id="@+id/nav_net_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/netsearch"
android:visible="false" />
android:visible="true" />
<item
android:id="@+id/nav_yuepic"
android:icon="@drawable/ic_photo_white_24dp"
Expand Down
92 changes: 92 additions & 0 deletions app/src/playstore/res/menu/menu_drawer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="@string/location">
<menu>
<group
android:id="@+id/navigation_drawer_menu_category_sections"
android:checkableBehavior="single">
<item
android:id="@+id/nav_library"
android:icon="@drawable/ic_library_music_white_24dp"
android:title="@string/library" />
<item
android:id="@+id/nav_folders"
android:icon="@drawable/ic_folder_white_24dp"
android:title="@string/folders" />
<item
android:id="@+id/nav_net_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/netsearch"
android:visible="false" />
<item
android:id="@+id/nav_yuepic"
android:icon="@drawable/ic_photo_white_24dp"
android:title="@string/yuepic"
android:visible="false" />
</group>
</menu>
</item>

<!-- TODO: 网络位置 (开源歌曲) -->
<item
android:title="Net Location"
android:visible="false">
<menu>
<group android:id="@+id/navigation_drawer_menu_category_net_location">
<item android:title="- Net Home -" />
<item android:title="jamendo.com" />
<item android:title="soundcloud.com" />
<item android:title="ccmixter.org" />
</group>
</menu>
</item>

<item android:title="Tools">
<menu>
<group android:checkableBehavior="none">
<item
android:id="@+id/nav_data_overview"
android:icon="@drawable/ic_data_usage_white_24dp"
android:title="@string/data_overview" />

<item
android:id="@+id/action_scan"
android:icon="@drawable/ic_scanner_white_24dp"
android:title="@string/scan_media" />
</group>
</menu>
</item>

<item android:title="Other">
<menu>
<group
android:id="@+id/navigation_drawer_menu_category_other"
android:checkableBehavior="none">
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings_white_24dp"
android:title="@string/action_settings" />
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_help_white_24dp"
android:title="@string/action_about" />
<item
android:id="@+id/nav_exit"
android:icon="@drawable/ic_exit_to_app_white_24dp"
android:title="Exit" />
</group>
</menu>
</item>

<group
android:id="@+id/navigation_drawer_menu_category_buy_pro"
android:checkableBehavior="none"
android:visible="false">
<item
android:id="@+id/buy_pro"
android:icon="@drawable/ic_local_play_white_24dp"
android:title="@string/buy_pro" />
</group>

</menu>

0 comments on commit cc27191

Please sign in to comment.