添加调试模块
This commit is contained in:
parent
db3a3644a8
commit
2ba2f88510
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Jun 04 12:14:48 HKT 2025
|
#Wed Jun 04 05:15:44 GMT 2025
|
||||||
stageCount=6
|
stageCount=6
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.8
|
baseVersion=15.8
|
||||||
publishVersion=15.8.5
|
publishVersion=15.8.5
|
||||||
buildCount=0
|
buildCount=10
|
||||||
baseBetaVersion=15.8.6
|
baseBetaVersion=15.8.6
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Jun 04 12:14:48 HKT 2025
|
#Wed Jun 04 05:15:44 GMT 2025
|
||||||
stageCount=6
|
stageCount=6
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.8
|
baseVersion=15.8
|
||||||
publishVersion=15.8.5
|
publishVersion=15.8.5
|
||||||
buildCount=0
|
buildCount=10
|
||||||
baseBetaVersion=15.8.6
|
baseBetaVersion=15.8.6
|
||||||
|
@ -11,6 +11,8 @@ import java.io.IOException;
|
|||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen<zhangsken@188.com>
|
* @Author ZhanGSKen<zhangsken@188.com>
|
||||||
@ -21,7 +23,13 @@ public class YunActivity extends Activity implements IWinBoLLActivity {
|
|||||||
|
|
||||||
public static final String TAG = "YunActivity";
|
public static final String TAG = "YunActivity";
|
||||||
|
|
||||||
String mYunHost = "";
|
public static final String DEBUG_HOST = "http://10.8.0.250:456";
|
||||||
|
public static final String YUN_HOST = "https://yun.winboll.cc";
|
||||||
|
|
||||||
|
String mHost = "";
|
||||||
|
RadioButton mrbYunHost;
|
||||||
|
RadioButton mrbDebugHost;
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Activity getActivity() {
|
public Activity getActivity() {
|
||||||
@ -37,7 +45,34 @@ public class YunActivity extends Activity implements IWinBoLLActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_yun);
|
setContentView(R.layout.activity_yun);
|
||||||
mYunHost = BuildConfig.DEBUG ?"http://10.8.0.250:456": "https://yun.winboll.cc";
|
mLogView = findViewById(R.id.logview);
|
||||||
|
mLogView.start();
|
||||||
|
|
||||||
|
mHost = BuildConfig.DEBUG ? DEBUG_HOST: YUN_HOST;
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
mrbYunHost = findViewById(R.id.rb_yunhost);
|
||||||
|
mrbDebugHost = findViewById(R.id.rb_debughost);
|
||||||
|
mrbYunHost.setChecked(!BuildConfig.DEBUG);
|
||||||
|
mrbDebugHost.setChecked(BuildConfig.DEBUG);
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.ll_hostbar).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSwitchHost(View view) {
|
||||||
|
if (view.getId() == R.id.rb_yunhost) {
|
||||||
|
mrbDebugHost.setChecked(false);
|
||||||
|
mHost = YUN_HOST;
|
||||||
|
} else if (view.getId() == R.id.rb_debughost) {
|
||||||
|
mrbYunHost.setChecked(false);
|
||||||
|
mHost = DEBUG_HOST;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestYun(View view) {
|
public void onTestYun(View view) {
|
||||||
@ -53,7 +88,7 @@ public class YunActivity extends Activity implements IWinBoLLActivity {
|
|||||||
void testYun() {
|
void testYun() {
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(mYunHost + "/backups/")
|
.url(mHost + "/backups/")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Response response = null;
|
Response response = null;
|
||||||
|
@ -9,7 +9,34 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:gravity="right"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:id="@+id/ll_hostbar">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="10.8.0.250:456"
|
||||||
|
android:id="@+id/rb_debughost"
|
||||||
|
android:onClick="onSwitchHost"/>
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="yun.winboll.cc"
|
||||||
|
android:id="@+id/rb_yunhost"
|
||||||
|
android:onClick="onSwitchHost"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -19,5 +46,18 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user