更换主页效果
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.tt.ttutils.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
@@ -13,7 +15,9 @@ import android.widget.EditText;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.tt.ttutils.BuildConfig;
|
||||
import com.tt.ttutils.R;
|
||||
import com.tt.ttutils.base.BaseActivity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -22,7 +26,7 @@ import java.util.Map;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class AoleyunTestActivity extends AppCompatActivity {
|
||||
public class AoleyunTestActivity extends BaseActivity {
|
||||
private static final String TAG = AoleyunTestActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.bt_usb)
|
||||
@@ -137,15 +141,33 @@ public class AoleyunTestActivity extends AppCompatActivity {
|
||||
@BindView(R.id.bt_browser_off)
|
||||
Button bt_browser_off;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_aoleyun_test;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_aoleyun_test);
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
if (BuildConfig.DEBUG) {
|
||||
// ApkUtils.openApp(this, "com.android.settings");
|
||||
//静音
|
||||
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
int ringMax = audioManager.getStreamMinVolumeInt(AudioManager.STREAM_RING);
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_RING, ringMax, 0);
|
||||
int musicMax = audioManager.getStreamMinVolumeInt(AudioManager.STREAM_MUSIC);
|
||||
int voiceMax = audioManager.getStreamMinVolumeInt(AudioManager.STREAM_VOICE_CALL);
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, voiceMax, 0);
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, musicMax, 0); //音乐音量
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
bt_usb_charge.setOnClickListener(view -> {
|
||||
Intent usbIntent = new Intent("aole_action_usb_usb_charge").setPackage("com.android.settings");
|
||||
@@ -186,6 +208,14 @@ public class AoleyunTestActivity extends AppCompatActivity {
|
||||
bt_sd_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_sdcard_forbid_on", 0));
|
||||
bt_sd_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_sdcard_forbid_on", 1));
|
||||
|
||||
bt_developer_statu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int aole_Developeroptions = Settings.System.getInt(getContentResolver(), "aole_Developeroptions", 0);
|
||||
Log.e(TAG, "onClick: aole_Developeroptions = " + aole_Developeroptions);
|
||||
bt_developer_statu.setText("状态:" + aole_Developeroptions);
|
||||
}
|
||||
});
|
||||
bt_developer_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_Developeroptions", 0));
|
||||
bt_developer_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_Developeroptions", 1));
|
||||
|
||||
@@ -252,10 +282,11 @@ public class AoleyunTestActivity extends AppCompatActivity {
|
||||
bt_browser_statu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent= new Intent(); intent.setAction("android.intent.action.VIEW");
|
||||
Uri content_url = Uri.parse("https://www.baidu.com/");
|
||||
intent.setData(content_url);
|
||||
startActivity(intent);
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.intent.action.VIEW");
|
||||
Uri content_url = Uri.parse("https://www.baidu.com/");
|
||||
intent.setData(content_url);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
bt_browser_on.setOnClickListener(view -> {
|
||||
|
||||
Reference in New Issue
Block a user