├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── reedoverflow │ │ └── saiminapp │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── reedoverflow │ │ │ └── saiminapp │ │ │ ├── MainActivity.java │ │ │ ├── MyApplication.java │ │ │ ├── ui │ │ │ ├── home │ │ │ │ ├── HomeFragment.java │ │ │ │ ├── HomeViewModel.java │ │ │ │ ├── basicmode │ │ │ │ │ ├── BaiscFragment.java │ │ │ │ │ └── BaiscViewModel.java │ │ │ │ └── extendmode │ │ │ │ │ └── ExtendFragment.java │ │ │ └── settings │ │ │ │ └── SettingFragment.java │ │ │ └── utils │ │ │ └── RippleBackground.java │ └── res │ │ ├── drawable │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_menu_home.xml │ │ ├── ic_menu_settings.xml │ │ ├── ic_menu_switch.xml │ │ └── side_nav_bar.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── app_bar_main.xml │ │ ├── content_main.xml │ │ ├── fragment_baisc.xml │ │ ├── fragment_extend.xml │ │ ├── fragment_home.xml │ │ ├── fragment_setting.xml │ │ └── nav_header_main.xml │ │ ├── menu │ │ ├── activity_main_drawer.xml │ │ └── main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── navigation │ │ └── mobile_navigation.xml │ │ ├── raw │ │ └── notices.xml │ │ ├── values-en │ │ ├── array.xml │ │ └── strings.xml │ │ ├── values │ │ ├── array.xml │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── dimensions.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── settings.xml │ └── test │ └── java │ └── com │ └── reedoverflow │ └── saiminapp │ └── ExampleUnitTest.java ├── art └── Screenshot_1.png ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | .idea/workspace.xml 42 | .idea/tasks.xml 43 | .idea/gradle.xml 44 | .idea/assetWizardSettings.xml 45 | .idea/dictionaries 46 | .idea/libraries 47 | # Android Studio 3 in .gitignore file. 48 | .idea/caches 49 | .idea/modules.xml 50 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 51 | .idea/navEditor.xml 52 | 53 | # Keystore files 54 | # Uncomment the following lines if you do not want to check your keystore files in. 55 | #*.jks 56 | #*.keystore 57 | 58 | # External native build folder generated in Android Studio 2.2 and later 59 | .externalNativeBuild 60 | .cxx/ 61 | 62 | # Google Services (e.g. APIs or Firebase) 63 | # google-services.json 64 | 65 | # Freeline 66 | freeline.py 67 | freeline/ 68 | freeline_project_description.json 69 | 70 | # fastlane 71 | fastlane/report.xml 72 | fastlane/Preview.html 73 | fastlane/screenshots 74 | fastlane/test_output 75 | fastlane/readme.md 76 | 77 | # Version control 78 | vcs.xml 79 | 80 | # lint 81 | lint/intermediates/ 82 | lint/generated/ 83 | lint/outputs/ 84 | lint/tmp/ 85 | # lint/reports/ 86 | /.idea/ 87 | /app/release/output.json 88 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 reed-overflow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Saimin-APP 2 | 一个你在寻找的冻鳗风格催眠App。 3 | 4 | A hentai style saimin app you are looking for. 5 | 6 | ## 应用截图 Screenshot 7 | ![screenshot](https://cdn.jsdelivr.net/gh/reed-overflow/Saimin-APP/art/Screenshot_1.png) 8 | 9 | ## TODO 10 | - [x] Mode switch 11 | - [x] Home page animation 12 | - [x] Sensitive mode 13 | - [x] Bubbleseekbar 14 | - [x] Background visual effects improve 15 | - [ ] Custom mode 16 | - [ ] Check update 17 | - [ ] App intro 18 | - [ ] Shortcut 19 | - [ ] Notification 20 | - [ ] More mode 21 | 22 | ## Thanks 23 | - [LicensesDialog](https://github.com/PSDev/LicensesDialog) 24 | - [android-ripple-background](https://github.com/skyfishjy/android-ripple-background) 25 | - [SwitchButton](https://github.com/kyleduo/SwitchButton) 26 | - [BubbleSeekBar](https://github.com/woxingxiao/BubbleSeekBar) 27 | - [RippleAnimation](https://github.com/Ifxcyr/RippleAnimation) 28 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | applicationId "com.reedoverflow.saiminapp" 9 | minSdkVersion 23 10 | targetSdkVersion 29 11 | versionCode 2 12 | versionName "0.1.1b" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | compileOptions { 25 | sourceCompatibility JavaVersion.VERSION_1_8 26 | targetCompatibility JavaVersion.VERSION_1_8 27 | } 28 | 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(dir: "libs", include: ["*.jar"]) 33 | implementation 'androidx.appcompat:appcompat:1.1.0' 34 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 35 | implementation 'com.google.android.material:material:1.0.0' 36 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 37 | implementation 'androidx.navigation:navigation-fragment:2.1.0' 38 | implementation 'androidx.navigation:navigation-ui:2.1.0' 39 | implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' 40 | implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' 41 | testImplementation 'junit:junit:4.12' 42 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 44 | 45 | implementation 'androidx.preference:preference:1.1.1' 46 | 47 | // LicensesDialog 48 | implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0' 49 | 50 | implementation 'com.kyleduo.switchbutton:library:2.0.0' 51 | 52 | implementation 'com.xw.repo:bubbleseekbar:3.20-lite' 53 | 54 | implementation 'com.wuyr:rippleanimation:1.0.0' 55 | 56 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/reedoverflow/saiminapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.reedoverflow.saiminapp", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp; 2 | 3 | import android.os.Bundle; 4 | import android.view.Menu; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.appcompat.app.AppCompatActivity; 8 | import androidx.appcompat.app.AppCompatDelegate; 9 | import androidx.appcompat.widget.Toolbar; 10 | import androidx.drawerlayout.widget.DrawerLayout; 11 | import androidx.navigation.NavController; 12 | import androidx.navigation.Navigation; 13 | import androidx.navigation.ui.AppBarConfiguration; 14 | import androidx.navigation.ui.NavigationUI; 15 | 16 | import com.google.android.material.navigation.NavigationView; 17 | 18 | public class MainActivity extends AppCompatActivity { 19 | 20 | private AppBarConfiguration mAppBarConfiguration; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_main); 26 | Toolbar toolbar = findViewById(R.id.toolbar); 27 | setSupportActionBar(toolbar); 28 | 29 | DrawerLayout drawer = findViewById(R.id.drawer_layout); 30 | NavigationView navigationView = findViewById(R.id.nav_view); 31 | // Passing each menu ID as a set of Ids because each 32 | // menu should be considered as top level destinations. 33 | mAppBarConfiguration = new AppBarConfiguration.Builder( 34 | R.id.nav_home, R.id.nav_settings) 35 | .setDrawerLayout(drawer) 36 | .build(); 37 | NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); 38 | NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration); 39 | NavigationUI.setupWithNavController(navigationView, navController); 40 | } 41 | 42 | @Override 43 | public boolean onCreateOptionsMenu(Menu menu) { 44 | // Inflate the menu; this adds items to the action bar if it is present. 45 | // getMenuInflater().inflate(R.menu.main, menu); 46 | return true; 47 | } 48 | 49 | @Override 50 | public boolean onSupportNavigateUp() { 51 | NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); 52 | return NavigationUI.navigateUp(navController, mAppBarConfiguration) 53 | || super.onSupportNavigateUp(); 54 | } 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp; 2 | 3 | import android.app.Application; 4 | 5 | public class MyApplication extends Application { 6 | 7 | @Override 8 | public void onCreate() { 9 | super.onCreate(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/home/HomeFragment.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.home; 2 | 3 | import android.content.SharedPreferences; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.fragment.app.Fragment; 11 | import androidx.lifecycle.ViewModelProviders; 12 | import androidx.preference.PreferenceManager; 13 | 14 | import com.reedoverflow.saiminapp.R; 15 | import com.reedoverflow.saiminapp.ui.home.basicmode.BaiscFragment; 16 | import com.reedoverflow.saiminapp.ui.home.extendmode.ExtendFragment; 17 | 18 | import java.util.Objects; 19 | 20 | public class HomeFragment extends Fragment { 21 | 22 | private HomeViewModel homeViewModel; 23 | 24 | @Override 25 | public View onCreateView(@NonNull LayoutInflater inflater, 26 | ViewGroup container, Bundle savedInstanceState) { 27 | homeViewModel = 28 | ViewModelProviders.of(this).get(HomeViewModel.class); 29 | View root = inflater.inflate(R.layout.fragment_home, container, false); 30 | 31 | checkMode(); 32 | return root; 33 | } 34 | 35 | private void checkMode() { 36 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); 37 | int option = Integer.parseInt(Objects.requireNonNull(preferences.getString("switch", "0"))); 38 | 39 | switch (option) { 40 | case 0: { 41 | toFragment(BaiscFragment.newInstance()); 42 | break; 43 | } 44 | case 1: { 45 | toFragment(ExtendFragment.newInstance()); 46 | break; 47 | } 48 | } 49 | } 50 | 51 | private void toFragment(Fragment fragment) { 52 | requireActivity().getSupportFragmentManager().beginTransaction().add(R.id.fragment_cont, fragment).commit(); 53 | } 54 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/home/HomeViewModel.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.home; 2 | 3 | import androidx.lifecycle.ViewModel; 4 | 5 | public class HomeViewModel extends ViewModel { 6 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/home/basicmode/BaiscFragment.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.home.basicmode; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.CompoundButton; 9 | import android.widget.TextView; 10 | 11 | import androidx.annotation.NonNull; 12 | import androidx.annotation.Nullable; 13 | import androidx.cardview.widget.CardView; 14 | import androidx.fragment.app.Fragment; 15 | import androidx.lifecycle.Observer; 16 | import androidx.lifecycle.ViewModelProviders; 17 | 18 | import com.kyleduo.switchbutton.SwitchButton; 19 | import com.reedoverflow.saiminapp.R; 20 | import com.reedoverflow.saiminapp.utils.RippleBackground; 21 | import com.wuyr.rippleanimation.RippleAnimation; 22 | 23 | public class BaiscFragment extends Fragment { 24 | 25 | private BaiscViewModel baiscViewModel; 26 | private SwitchButton homeSwitch; 27 | private RippleBackground rippleBackground; 28 | private CardView cardView; 29 | 30 | public static BaiscFragment newInstance() { 31 | return new BaiscFragment(); 32 | } 33 | 34 | @Override 35 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, 36 | @Nullable Bundle savedInstanceState) { 37 | baiscViewModel = ViewModelProviders.of(this).get(BaiscViewModel.class); 38 | View root = inflater.inflate(R.layout.fragment_baisc, container, false); 39 | 40 | final TextView homeText = root.findViewById(R.id.home_text); 41 | rippleBackground = root.findViewById(R.id.ripple_bg); 42 | homeSwitch = root.findViewById(R.id.home_switch); 43 | 44 | baiscViewModel.getHomeText().observe(getViewLifecycleOwner(), new Observer() { 45 | @Override 46 | public void onChanged(String s) { 47 | homeText.setText(s); 48 | } 49 | }); 50 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_stop)); 51 | 52 | cardView = root.findViewById(R.id.basic_card_view); 53 | 54 | homeSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 55 | @Override 56 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 57 | 58 | if (isChecked) { 59 | saiminStart(); 60 | } else { 61 | RippleAnimation.create(homeSwitch).setDuration(1000).start(); 62 | saiminStop(); 63 | cardView.setCardBackgroundColor(getResources().getColor(R.color.card_bg)); 64 | } 65 | } 66 | }); 67 | 68 | return root; 69 | } 70 | 71 | @Override 72 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 73 | super.onActivityCreated(savedInstanceState); 74 | baiscViewModel = ViewModelProviders.of(this).get(BaiscViewModel.class); 75 | } 76 | 77 | //临时模拟 78 | private void saiminStart() { 79 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_starting)); 80 | homeSwitch.setEnabled(false); 81 | 82 | new Handler().postDelayed(new Runnable() { 83 | @Override 84 | public void run() { 85 | RippleAnimation.create(homeSwitch).setDuration(3000).start(); 86 | cardView.setCardBackgroundColor(getResources().getColor(R.color.card_bg_alter)); 87 | 88 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_start)); 89 | homeSwitch.setEnabled(true); 90 | 91 | rippleBackground.startRippleAnimation(); 92 | } 93 | }, 2000); 94 | } 95 | 96 | //临时模拟 97 | private void saiminStop() { 98 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_shutdown)); 99 | homeSwitch.setEnabled(false); 100 | rippleBackground.stopRippleAnimation(); 101 | 102 | new Handler().postDelayed(new Runnable() { 103 | @Override 104 | public void run() { 105 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_stop)); 106 | homeSwitch.setEnabled(true); 107 | } 108 | }, 1000); 109 | } 110 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/home/basicmode/BaiscViewModel.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.home.basicmode; 2 | 3 | import androidx.lifecycle.MutableLiveData; 4 | import androidx.lifecycle.ViewModel; 5 | 6 | public class BaiscViewModel extends ViewModel { 7 | private MutableLiveData homeText; 8 | 9 | public BaiscViewModel() { 10 | homeText = new MutableLiveData<>(); 11 | } 12 | 13 | public MutableLiveData getHomeText() { 14 | return homeText; 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/home/extendmode/ExtendFragment.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.home.extendmode; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.annotation.Nullable; 6 | import androidx.cardview.widget.CardView; 7 | import androidx.lifecycle.Observer; 8 | import androidx.lifecycle.ViewModelProviders; 9 | 10 | import android.os.Handler; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.CompoundButton; 15 | import android.widget.TextView; 16 | 17 | import com.kyleduo.switchbutton.SwitchButton; 18 | import com.reedoverflow.saiminapp.R; 19 | import com.reedoverflow.saiminapp.ui.home.basicmode.BaiscFragment; 20 | import com.reedoverflow.saiminapp.ui.home.basicmode.BaiscViewModel; 21 | import com.reedoverflow.saiminapp.utils.RippleBackground; 22 | import com.wuyr.rippleanimation.RippleAnimation; 23 | 24 | public class ExtendFragment extends BaiscFragment { 25 | 26 | private BaiscViewModel baiscViewModel; 27 | private SwitchButton homeSwitch; 28 | private RippleBackground rippleBackground; 29 | private CardView cardView; 30 | 31 | public static ExtendFragment newInstance() { 32 | ExtendFragment fragment = new ExtendFragment(); 33 | return fragment; 34 | } 35 | 36 | @Override 37 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 38 | Bundle savedInstanceState) { 39 | baiscViewModel = ViewModelProviders.of(this).get(BaiscViewModel.class); 40 | View root = inflater.inflate(R.layout.fragment_extend, container, false); 41 | 42 | final TextView homeText = root.findViewById(R.id.home_text); 43 | rippleBackground = root.findViewById(R.id.ripple_bg); 44 | homeSwitch = root.findViewById(R.id.home_switch); 45 | 46 | baiscViewModel.getHomeText().observe(getViewLifecycleOwner(), new Observer() { 47 | @Override 48 | public void onChanged(String s) { 49 | homeText.setText(s); 50 | } 51 | }); 52 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_stop)); 53 | 54 | cardView = root.findViewById(R.id.sensitive_card_view); 55 | 56 | 57 | homeSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 58 | @Override 59 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 60 | if (isChecked) { 61 | saiminStart(); 62 | } else { 63 | RippleAnimation.create(homeSwitch).setDuration(1000).start(); 64 | saiminStop(); 65 | cardView.setCardBackgroundColor(getResources().getColor(R.color.card_bg)); 66 | } 67 | } 68 | }); 69 | 70 | return root; 71 | } 72 | 73 | @Override 74 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 75 | super.onActivityCreated(savedInstanceState); 76 | baiscViewModel = ViewModelProviders.of(this).get(BaiscViewModel.class); 77 | } 78 | 79 | //临时模拟 80 | private void saiminStart() { 81 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_starting)); 82 | homeSwitch.setEnabled(false); 83 | 84 | new Handler().postDelayed(new Runnable() { 85 | @Override 86 | public void run() { 87 | RippleAnimation.create(homeSwitch).setDuration(3000).start(); 88 | cardView.setCardBackgroundColor(getResources().getColor(R.color.card_bg_alter)); 89 | 90 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_start)); 91 | homeSwitch.setEnabled(true); 92 | 93 | rippleBackground.startRippleAnimation(); 94 | } 95 | }, 2000); 96 | } 97 | 98 | //临时模拟 99 | private void saiminStop() { 100 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_shutdown)); 101 | homeSwitch.setEnabled(false); 102 | rippleBackground.stopRippleAnimation(); 103 | 104 | new Handler().postDelayed(new Runnable() { 105 | @Override 106 | public void run() { 107 | baiscViewModel.getHomeText().postValue(getString(R.string.basic_saimin_stop)); 108 | homeSwitch.setEnabled(true); 109 | } 110 | }, 1000); 111 | } 112 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/ui/settings/SettingFragment.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.ui.settings; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | 7 | import androidx.preference.Preference; 8 | import androidx.preference.PreferenceFragmentCompat; 9 | 10 | import com.reedoverflow.saiminapp.R; 11 | 12 | import de.psdev.licensesdialog.LicensesDialog; 13 | 14 | public class SettingFragment extends PreferenceFragmentCompat { 15 | 16 | @Override 17 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 18 | setPreferencesFromResource(R.xml.settings, rootKey); 19 | } 20 | 21 | @Override 22 | public boolean onPreferenceTreeClick(Preference preference) { 23 | switch (preference.getKey()) { 24 | case "about_author": 25 | openLink(getString(R.string.settings_author_detail)); 26 | break; 27 | case "about_repo": 28 | openLink(getString(R.string.settings_repo_detail)); 29 | break; 30 | case "license": 31 | new LicensesDialog.Builder(getActivity()).setNotices(R.raw.notices).build().show(); 32 | break; 33 | case "version": 34 | openLink("https://github.com/reed-overflow/Saimin-APP/releases"); 35 | break; 36 | default: 37 | break; 38 | } 39 | return super.onPreferenceTreeClick(preference); 40 | } 41 | 42 | private void openLink(String link) { 43 | Uri uri = Uri.parse(link); 44 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 45 | startActivity(intent); 46 | } 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/reedoverflow/saiminapp/utils/RippleBackground.java: -------------------------------------------------------------------------------- 1 | package com.reedoverflow.saiminapp.utils; 2 | 3 | import android.animation.Animator; 4 | import android.animation.AnimatorSet; 5 | import android.animation.ObjectAnimator; 6 | import android.content.Context; 7 | import android.content.res.TypedArray; 8 | import android.graphics.Canvas; 9 | import android.graphics.Paint; 10 | import android.util.AttributeSet; 11 | import android.view.View; 12 | import android.view.animation.AccelerateDecelerateInterpolator; 13 | import android.widget.RelativeLayout; 14 | 15 | import com.reedoverflow.saiminapp.R; 16 | 17 | import java.util.ArrayList; 18 | 19 | /** 20 | * Created by fyu on 11/3/14. 21 | * 22 | * Edited by reed-overflow on 6/4/20 23 | */ 24 | 25 | public class RippleBackground extends RelativeLayout{ 26 | 27 | private static final int DEFAULT_RIPPLE_COUNT=6; 28 | private static final int DEFAULT_DURATION_TIME=3000; 29 | private static final float DEFAULT_SCALE=6.0f; 30 | private static final int DEFAULT_FILL_TYPE=0; 31 | 32 | private int rippleColor; 33 | private float rippleStrokeWidth; 34 | private float rippleRadius; 35 | private int rippleDurationTime; 36 | private int rippleAmount; 37 | private int rippleDelay; 38 | private float rippleScale; 39 | private int rippleType; 40 | private Paint paint; 41 | private boolean animationRunning=false; 42 | private AnimatorSet animatorSet; 43 | private ArrayList animatorList; 44 | private LayoutParams rippleParams; 45 | private ArrayList rippleViewList=new ArrayList(); 46 | 47 | public RippleBackground(Context context) { 48 | super(context); 49 | } 50 | 51 | public RippleBackground(Context context, AttributeSet attrs) { 52 | super(context, attrs); 53 | init(context, attrs); 54 | } 55 | 56 | public RippleBackground(Context context, AttributeSet attrs, int defStyleAttr) { 57 | super(context, attrs, defStyleAttr); 58 | init(context, attrs); 59 | } 60 | 61 | private void init(final Context context, final AttributeSet attrs) { 62 | if (isInEditMode()) 63 | return; 64 | 65 | if (null == attrs) { 66 | throw new IllegalArgumentException("Attributes should be provided to this view,"); 67 | } 68 | 69 | final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground); 70 | rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippelColor)); 71 | rippleStrokeWidth=typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, getResources().getDimension(R.dimen.rippleStrokeWidth)); 72 | rippleRadius=typedArray.getDimension(R.styleable.RippleBackground_rb_radius,getResources().getDimension(R.dimen.rippleRadius)); 73 | rippleDurationTime=typedArray.getInt(R.styleable.RippleBackground_rb_duration,DEFAULT_DURATION_TIME); 74 | rippleAmount=typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount,DEFAULT_RIPPLE_COUNT); 75 | rippleScale=typedArray.getFloat(R.styleable.RippleBackground_rb_scale,DEFAULT_SCALE); 76 | rippleType=typedArray.getInt(R.styleable.RippleBackground_rb_type,DEFAULT_FILL_TYPE); 77 | typedArray.recycle(); 78 | 79 | rippleDelay=rippleDurationTime/rippleAmount; 80 | 81 | paint = new Paint(); 82 | paint.setAntiAlias(true); 83 | if(rippleType==DEFAULT_FILL_TYPE){ 84 | rippleStrokeWidth=0; 85 | paint.setStyle(Paint.Style.FILL); 86 | }else { 87 | paint.setStrokeWidth(rippleStrokeWidth); 88 | paint.setStyle(Paint.Style.STROKE); 89 | } 90 | paint.setColor(rippleColor); 91 | 92 | rippleParams=new LayoutParams((int)(2*(rippleRadius+rippleStrokeWidth)),(int)(2*(rippleRadius+rippleStrokeWidth))); 93 | rippleParams.addRule(CENTER_IN_PARENT, TRUE); 94 | 95 | animatorSet = new AnimatorSet(); 96 | animatorSet.setInterpolator(new AccelerateDecelerateInterpolator()); 97 | animatorList=new ArrayList(); 98 | 99 | for(int i=0;i 2 | 8 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_home.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_settings.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_switch.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_baisc.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 22 | 23 | 34 | 35 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_extend.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 22 | 23 | 34 | 35 | 43 | 44 | 45 | 46 | 47 | 48 | 53 | 54 | 64 | 65 | 72 | 73 | 79 | 80 | 98 | 99 | 100 | 101 | 102 | 110 | 111 | 117 | 118 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reed-overflow/Saimin-APP/68c5eec0c4274f99dcad5bc03627e51acd8bbabc/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/navigation/mobile_navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/raw/notices.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Saimin-APP 5 | https://github.com/reed-overflow/Saimin-APP 6 | Copyright (c) 2020 reed-overflow 7 | MIT License 8 | 9 | 10 | 11 | LicensesDialog 12 | https://github.com/PSDev/LicensesDialog 13 | Copyright 2013 Philip Schiffer 14 | Apache Software License 2.0 15 | 16 | 17 | 18 | android-ripple-background 19 | https://github.com/skyfishjy/android-ripple-background 20 | Copyright (c) 2014 Yao Yu 21 | MIT License 22 | 23 | 24 | 25 | SwitchButton 26 | https://github.com/kyleduo/SwitchButton 27 | Apache Software License 2.0 28 | 29 | 30 | 31 | BubbleSeekBar 32 | https://github.com/woxingxiao/BubbleSeekBar 33 | Copyright 2017 woxingxiao 34 | Apache Software License 2.0 35 | 36 | 37 | 38 | RippleAnimation 39 | https://github.com/Ifxcyr/RippleAnimation 40 | Apache Software License 2.0 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/values-en/array.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | "Basic mode" 4 | "Extend mode" 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-en/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Saimin APP 3 | 4 | Home 5 | Settings 6 | 7 | Switch mode 8 | Switch saimin mode 9 | 10 | Author info 11 | 12 | Repo link 13 | 14 | License 15 | License info 16 | 17 | Version 18 | 19 | Saimin service stopped 20 | Saimin service started 21 | Saimin service starting… 22 | Shutdown Saimin service… 23 | 24 | Sensitive 25 | Obey 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/array.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | "基础模式" 4 | "扩展模式" 5 | 6 | 7 | 0 8 | 1 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F48FB1 4 | #F06292 5 | #81D4FA 6 | 7 | #0099CC 8 | 9 | #fff 10 | #000 11 | 12 | @color/white 13 | @color/black 14 | @color/colorPrimary 15 | @color/colorAccent 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 8dp 6 | 176dp 7 | 16dp 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2dp 4 | 64dp 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F48FB1 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Saimin APP 3 | 4 | 主页 5 | 设置 6 | 7 | 模式切换 8 | 切换应用模式 9 | 10 | 作者信息 11 | https://github.com/reed-overflow 12 | 13 | 项目地址 14 | https://github.com/reed-overflow/Saimin-APP 15 | 16 | License 17 | 开源许可 18 | 19 | 版本 20 | 0.1.1b 21 | 22 | 未启动 23 | 催眠中 24 | 催眠服务启动中… 25 | 催眠服务关闭中… 26 | 27 | 敏感度 28 | 服从度 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 14 | 15 |