-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
354 additions
and
10 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
21 changes: 21 additions & 0 deletions
21
app/src/main/java/cn/wearbbs/music/application/MyApplication.java
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,21 @@ | ||
package cn.wearbbs.music.application; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
/** | ||
* @author JackuXL | ||
*/ | ||
public class MyApplication extends Application { | ||
private static Context context; | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
context = getApplicationContext(); | ||
} | ||
public static Context getContext(){ | ||
return context; | ||
} | ||
|
||
} |
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,17 @@ | ||
package cn.wearbbs.music.detail; | ||
|
||
/** | ||
* @author JackuXL | ||
*/ | ||
public class Data { | ||
public static String versionText = "version"; | ||
public static double version = 2.2; | ||
public static int successCode = 200; | ||
public static int errorCode = 400; | ||
public static int likeMode = 1; | ||
public static int dislikeMode = 0; | ||
public static int localMode = 1; | ||
public static int playListMode = 3; | ||
public static int fmMode = 3; | ||
public static int defaultMode = 0; | ||
} |
46 changes: 46 additions & 0 deletions
46
app/src/main/java/cn/wearbbs/music/ui/SettingActivity.java
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,46 @@ | ||
package cn.wearbbs.music.ui; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.appcompat.widget.SwitchCompat; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.CompoundButton; | ||
import android.widget.Switch; | ||
|
||
import cn.wearbbs.music.R; | ||
import cn.wearbbs.music.util.UserInfoUtil; | ||
|
||
/** | ||
* @author JackuXL | ||
*/ | ||
public class SettingActivity extends AppCompatActivity { | ||
|
||
Switch switchFM; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_setting); | ||
switchFM = findViewById(R.id.switch_fm); | ||
String needFM = UserInfoUtil.getUserInfo(this,"needFM"); | ||
if("true".equals(needFM)){ | ||
switchFM.setChecked(true); | ||
} | ||
switchFM.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
if(isChecked){ | ||
UserInfoUtil.saveUserInfo(SettingActivity.this,"needFM","true"); | ||
} | ||
else{ | ||
UserInfoUtil.saveUserInfo(SettingActivity.this,"needFM","false"); | ||
} | ||
}); | ||
} | ||
public void onClick(View view){ | ||
Intent intent = new Intent(SettingActivity.this, AboutActivity.class); | ||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); | ||
startActivity(intent); | ||
} | ||
|
||
} |
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,22 @@ | ||
package cn.wearbbs.music.ui; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
import android.view.View; | ||
|
||
import cn.wearbbs.music.R; | ||
import cn.wearbbs.music.util.UserInfoUtil; | ||
|
||
public class TipsActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_tips); | ||
} | ||
public void known(View view){ | ||
UserInfoUtil.saveUserInfo(this,"finishTips","true"); | ||
finish(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/res/drawable/ic_baseline_arrow_back_24_white.xml
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,5 @@ | ||
<vector android:height="24dp" android:tint="#FAFAFA" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#FAFAFA" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#2175F3" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#2175F3" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#2175F3" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#2175F3" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M9,21h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.58,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2zM9,9l4.34,-4.34L12,10h9v2l-3,7H9V9zM1,9h4v12H1z"/> | ||
</vector> |
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,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="1024dp" | ||
android:height="1024dp" | ||
android:viewportWidth="1024" | ||
android:viewportHeight="1024"> | ||
<path | ||
android:pathData="M0,0h1024v1024h-1024z" | ||
android:fillColor="#2175f3"/> | ||
<path | ||
android:pathData="M511.76,354.54a150,150 0,0 0,-150 150V621.21a49.94,49.94 0,0 0,50 50h50V537.88H395.1V504.54a116.67,116.67 0,0 1,233.33 0v33.34H561.76V671.21h50a49.93,49.93 0,0 0,50 -50V504.54A150,150 0,0 0,511.76 354.54Z" | ||
android:fillColor="#fff"/> | ||
</vector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/ll_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#FAFAFA" | ||
android:orientation="vertical" | ||
tools:context=".ui.SettingActivity" | ||
tools:layout_editor_absoluteX="0dp" | ||
tools:layout_editor_absoluteY="0dp"> | ||
|
||
<TextView | ||
android:id="@+id/tv_title" | ||
android:layout_width="match_parent" | ||
android:layout_height="33dp" | ||
android:background="@color/colorPrimary" | ||
android:gravity="center" | ||
android:onClick="onClick" | ||
android:text="@string/setting" | ||
android:textColor="#FFFFFF" | ||
android:textSize="13sp" /> | ||
|
||
<Switch | ||
android:id="@+id/switch_fm" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="10dp" | ||
android:paddingLeft="25dp" | ||
android:paddingRight="25dp" | ||
android:text="@string/checkFM" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_about" | ||
android:layout_width="match_parent" | ||
android:layout_height="40dp" | ||
android:layout_marginTop="10dp" | ||
android:background="@drawable/ripple_item_normal" | ||
android:gravity="center_vertical" | ||
android:onClick="onClick" | ||
android:paddingLeft="25dp" | ||
android:paddingTop="5dp" | ||
android:paddingRight="25dp" | ||
android:paddingBottom="5dp" | ||
android:text="@string/aboutApp" | ||
android:textColor="#242423" /> | ||
|
||
</LinearLayout> |
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,53 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ui.TipsActivity"> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:id="@+id/ll_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/tv_title" | ||
android:layout_width="match_parent" | ||
android:layout_height="33dp" | ||
android:background="@color/colorPrimary" | ||
android:gravity="center" | ||
android:text="@string/tips" | ||
android:textColor="#FFFFFF" | ||
android:textSize="13sp" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_tip" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginTop="5dp" | ||
android:layout_marginRight="10dp" | ||
android:gravity="center" | ||
android:text="@string/tip" /> | ||
|
||
<Button | ||
android:id="@+id/btn_known" | ||
android:layout_width="wrap_content" | ||
android:layout_height="37dp" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="5dp" | ||
android:layout_marginBottom="10dp" | ||
android:background="@drawable/btn_blue" | ||
android:onClick="known" | ||
android:text="@string/known" | ||
android:textColor="#FFFFFF" /> | ||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.