Initial commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class AboutPresenter extends RxPresenter<AboutView> {
|
||||
|
||||
public interface AboutView extends BaseRxView {
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.entities.SettingitemBean;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
import com.ubt.jimu.user.setting.view.CommonSettingView;
|
||||
import com.ubt.jimu.utils.LocaleUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CommonSettingPresenter extends RxPresenter<CommonSettingView> {
|
||||
public List<SettingitemBean> a = new ArrayList();
|
||||
|
||||
public List<SettingitemBean> a() {
|
||||
String[] stringArray = JimuApplication.l().getResources().getStringArray(R.array.setting_item);
|
||||
for (int i = 0; i < stringArray.length; i++) {
|
||||
SettingitemBean settingitemBean = new SettingitemBean();
|
||||
if (i == 0) {
|
||||
settingitemBean.setChoose(true);
|
||||
}
|
||||
if (LocaleUtils.f() || i != 8) {
|
||||
settingitemBean.setName(stringArray[i]);
|
||||
settingitemBean.setIndex(i);
|
||||
this.a.add(settingitemBean);
|
||||
}
|
||||
}
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
getView().d(a());
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
for (int i2 = 0; i2 < this.a.size(); i2++) {
|
||||
this.a.get(i2).setChoose(false);
|
||||
}
|
||||
this.a.get(i).setChoose(true);
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.base.cache.SharePreferenceHelper;
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
import com.ubt.jimu.utils.GlideCacheUtils;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CommonUsePresenter extends RxPresenter<CommonUseView> {
|
||||
|
||||
public interface CommonUseView extends BaseRxView {
|
||||
void p();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
Observable.create(new ObservableOnSubscribe() { // from class: com.ubt.jimu.user.setting.presenter.a
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public final void subscribe(ObservableEmitter observableEmitter) {
|
||||
CommonUsePresenter.a(observableEmitter);
|
||||
}
|
||||
}).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<Boolean>() { // from class: com.ubt.jimu.user.setting.presenter.CommonUsePresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(Boolean bool) {
|
||||
GlideCacheUtils.a().b(JimuApplication.l());
|
||||
GlideCacheUtils.a().a(JimuApplication.l().getExternalCacheDir() + "image_manager_disk_cache", true);
|
||||
CommonUsePresenter.this.getView().p();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
CommonUsePresenter.this.add(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
new SharePreferenceHelper().put(SharePreferenceHelper.SP_KEY_INFO_TO, Boolean.valueOf(z));
|
||||
}
|
||||
|
||||
static /* synthetic */ void a(ObservableEmitter observableEmitter) throws Exception {
|
||||
GlideCacheUtils.a().a(JimuApplication.l());
|
||||
observableEmitter.onNext(true);
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
new SharePreferenceHelper().put(SharePreferenceHelper.SP_KEY_WIFI_VIEW, Boolean.valueOf(z));
|
||||
}
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CommonWebPresenter extends RxPresenter<CommonWebView> {
|
||||
|
||||
public interface CommonWebView extends BaseRxView {
|
||||
void a(ApiStatus apiStatus);
|
||||
|
||||
void h();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
UserRepository.a().observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.setting.presenter.CommonWebPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (CommonWebPresenter.this.getView() == null) {
|
||||
return;
|
||||
}
|
||||
if (apiStatus == null || apiStatus.getCode() != 0) {
|
||||
CommonWebPresenter.this.getView().h();
|
||||
} else {
|
||||
CommonWebPresenter.this.getView().a(apiStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
th.printStackTrace();
|
||||
CommonWebPresenter.this.getView().h();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
CommonWebPresenter.this.add(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class HardWarePresenter extends RxPresenter<HardWareView> {
|
||||
|
||||
public interface HardWareView extends BaseRxView {
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class LaboratoryPresenter extends RxPresenter<LaboratoryView> {
|
||||
|
||||
public interface LaboratoryView extends BaseRxView {
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class MyAccountPresenter extends RxPresenter<MyAccountView> {
|
||||
|
||||
public interface MyAccountView extends BaseRxView {
|
||||
void l();
|
||||
}
|
||||
|
||||
public void a(String str) {
|
||||
UserRepository.a(str).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.setting.presenter.MyAccountPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
MyAccountView view = MyAccountPresenter.this.getView();
|
||||
if (view != null) {
|
||||
view.l();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
MyAccountPresenter.this.add(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
package com.ubt.jimu.user.setting.presenter;
|
||||
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.mvp.BaseRxView;
|
||||
import com.ubt.jimu.base.mvp.RxPresenter;
|
||||
import com.ubt.jimu.blockly.Utils;
|
||||
import com.ubt.jimu.user.model.TeachModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class TeachPresenter extends RxPresenter<TeachView> {
|
||||
private String b;
|
||||
private String a = "jimu/help";
|
||||
private String c = "https://jimu.ubtrobot.com/%s/%s/%s";
|
||||
|
||||
public interface TeachView extends BaseRxView {
|
||||
void f(List<TeachModel> list);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.b = JimuApplication.l().c();
|
||||
if (!this.b.equals("CN")) {
|
||||
this.b = "EN";
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
TeachModel teachModel = new TeachModel();
|
||||
teachModel.a(JimuApplication.l().getString(R.string.setting_study_component));
|
||||
teachModel.b(String.format(this.c, this.a, this.b, "Component.html"));
|
||||
arrayList.add(teachModel);
|
||||
TeachModel teachModel2 = new TeachModel();
|
||||
teachModel2.a(JimuApplication.l().getString(R.string.setting_study_assemble));
|
||||
teachModel2.b(String.format(this.c, this.a, this.b, "Build.html"));
|
||||
teachModel2.c("https://video.ubtrobot.com/jimu/videos/build.mp4");
|
||||
teachModel2.a(R.drawable.setting_study_play);
|
||||
arrayList.add(teachModel2);
|
||||
TeachModel teachModel3 = new TeachModel();
|
||||
teachModel3.b(String.format(this.c, this.a, this.b, "Connect.html"));
|
||||
teachModel3.a(JimuApplication.l().getString(R.string.setting_study_connect));
|
||||
arrayList.add(teachModel3);
|
||||
TeachModel teachModel4 = new TeachModel();
|
||||
teachModel4.b(String.format(this.c, this.a, this.b, "Actions.html"));
|
||||
teachModel4.c("https://video.ubtrobot.com/jimu/videos/action.mp4");
|
||||
teachModel4.a(R.drawable.setting_study_play);
|
||||
teachModel4.a(JimuApplication.l().getString(R.string.setting_study_actions));
|
||||
arrayList.add(teachModel4);
|
||||
TeachModel teachModel5 = new TeachModel();
|
||||
teachModel5.a(JimuApplication.l().getString(R.string.setting_study_programming));
|
||||
teachModel5.b(Utils.getBlocklyHelpUrl());
|
||||
arrayList.add(teachModel5);
|
||||
TeachModel teachModel6 = new TeachModel();
|
||||
teachModel6.a(JimuApplication.l().getString(R.string.setting_qa));
|
||||
String g = JimuApplication.l().g();
|
||||
if (!"zh-hans".equals(g)) {
|
||||
g = "en";
|
||||
}
|
||||
teachModel6.b(String.format("https://video.ubtrobot.com/jimu/product/h5/QA/index_%s.html", g));
|
||||
arrayList.add(teachModel6);
|
||||
if (getView() != null) {
|
||||
getView().f(arrayList);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user