version:2.3
fix: update:固定横屏,增加家庭空间
This commit is contained in:
@@ -30,11 +30,10 @@ import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.manager.AmapManager;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.utils.BrightnessUtils;
|
||||
import com.uiuios.aios.view.RulerSeekBar;
|
||||
|
||||
@@ -726,49 +725,18 @@ public class ControlActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private LocationClient locationClient;
|
||||
|
||||
private void getLocation() {
|
||||
BDLocation bdLocation = AmapManager.getInstance().getNowMapLocation();
|
||||
if (bdLocation != null) {
|
||||
if (bdLocation.getLocType() == BDLocation.TypeGpsLocation // GPS定位结果
|
||||
|| bdLocation.getLocType() == BDLocation.TypeNetWorkLocation // 网络定位结果
|
||||
|| bdLocation.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果
|
||||
tv_location.setText(bdLocation.getAddrStr());
|
||||
} else {
|
||||
tv_location.setText("未知");
|
||||
}
|
||||
String addr = MMKV.defaultMMKV().decodeString(CommonConfig.MAP_ADDRESS_KEY);
|
||||
|
||||
if (TextUtils.isEmpty(addr)) {
|
||||
tv_location.setText("未知");
|
||||
} else {
|
||||
tv_location.setText("定位失败");
|
||||
tv_location.setText(addr);
|
||||
}
|
||||
startLocation();
|
||||
cl_location.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startLocation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void startLocation() {
|
||||
if (locationClient == null) {
|
||||
locationClient = AmapManager.getInstance().getLocationClient();
|
||||
}
|
||||
locationClient.stop();
|
||||
locationClient.start();
|
||||
locationClient.registerLocationListener(new BDAbstractLocationListener() {
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation bdLocation) {
|
||||
switch (bdLocation.getLocType()) {
|
||||
case BDLocation.TypeGpsLocation:// GPS定位结果
|
||||
case BDLocation.TypeNetWorkLocation:// 网络定位结果
|
||||
case BDLocation.TypeOffLineLocation:// 离线定位结果
|
||||
tv_location.setText(bdLocation.getAddrStr());
|
||||
break;
|
||||
default:
|
||||
tv_location.setText("定位失败");
|
||||
break;
|
||||
}
|
||||
RemoteManager.getInstance().getLocation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.manager.AmapManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.network.URLAddress;
|
||||
import com.uiuios.aios.receiver.BootReceiver;
|
||||
@@ -97,9 +97,9 @@ public class EmergencyActivity extends AppCompatActivity {
|
||||
Log.e(TAG, "accept: " + (time - aLong - 1));
|
||||
} else {
|
||||
MMKV mmkv = MMKV.defaultMMKV();
|
||||
String longitude = mCacheHelper.getAsString(AmapManager.LONGITUDE_KEY);
|
||||
String latitude = mCacheHelper.getAsString(AmapManager.LATITUDE_KEY);
|
||||
String address = mCacheHelper.getAsString(AmapManager.ADDRESS_KEY);
|
||||
String longitude = mCacheHelper.getAsString(CommonConfig.MAP_LONGITUDE_KEY);
|
||||
String latitude = mCacheHelper.getAsString(CommonConfig.MAP_LATITUDE_KEY);
|
||||
String address = mCacheHelper.getAsString(CommonConfig.MAP_ADDRESS_KEY);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSOSRecordObservable(longitude, latitude, address)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
|
||||
@@ -22,7 +22,12 @@ import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class QuickAppActivity extends BaseActivity {
|
||||
public static final String QUICK_APP_KEY = "QuickAppKey";
|
||||
private static final String TAG = QuickAppActivity.class.getSimpleName();
|
||||
|
||||
public static final String QUICK_APP_KEY = "QuickAppPackageKey";
|
||||
public static final String QUICK_APP_REFRESH_KEY = "QuickAppRefreshKey";
|
||||
public static final String QUICK_APP_ENABLED_KEY = "QuickAppEnabledKey";
|
||||
|
||||
private AppSelectedAdapter mAppSelectedAdapter;
|
||||
|
||||
@BindView(R.id.rv_goods)
|
||||
|
||||
@@ -23,7 +23,10 @@ import java.util.List;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class HealthCodeActivity extends BaseActivity implements HealthCodeContact.CodeView {
|
||||
public class FamilySpaceActivity extends BaseActivity implements FamilySpaceContact.CodeView {
|
||||
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
@BindView(R.id.viewPager)
|
||||
ViewPager mViewPager;
|
||||
@BindView(R.id.magicIndicator)
|
||||
@@ -31,21 +34,22 @@ public class HealthCodeActivity extends BaseActivity implements HealthCodeContac
|
||||
@BindView(R.id.iv_nodata)
|
||||
ImageView iv_nodata;
|
||||
|
||||
private HealthCodePresenter mPresenter;
|
||||
private FamilySpacePresenter mPresenter;
|
||||
private HealthCodeAdapter mHealthCodeAdapter;
|
||||
private ScaleCircleNavigator scaleCircleNavigator;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_code;
|
||||
return R.layout.activity_family_space;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
mPresenter = new HealthCodePresenter(this);
|
||||
mPresenter = new FamilySpacePresenter(this);
|
||||
mPresenter.attachView(this);
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
iv_back.setOnClickListener(view -> finish());
|
||||
mHealthCodeAdapter = new HealthCodeAdapter();
|
||||
mViewPager.setAdapter(mHealthCodeAdapter);
|
||||
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
||||
@@ -6,7 +6,7 @@ import com.uiuios.aios.bean.HealthCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HealthCodeContact {
|
||||
public class FamilySpaceContact {
|
||||
public interface Presenter extends BasePresenter<CodeView> {
|
||||
void getHealthCode();
|
||||
}
|
||||
@@ -13,9 +13,9 @@ import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public class HealthCodePresenter implements HealthCodeContact.Presenter {
|
||||
private static final String TAG = HealthCodePresenter.class.getSimpleName();
|
||||
private HealthCodeContact.CodeView mView;
|
||||
public class FamilySpacePresenter implements FamilySpaceContact.Presenter {
|
||||
private static final String TAG = FamilySpacePresenter.class.getSimpleName();
|
||||
private FamilySpaceContact.CodeView mView;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -29,14 +29,14 @@ public class HealthCodePresenter implements HealthCodeContact.Presenter {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
HealthCodePresenter(Context context) {
|
||||
FamilySpacePresenter(Context context) {
|
||||
this.mContext = context;
|
||||
Log.e(TAG, "MainPresenter: " + context.getClass());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void attachView(@NonNull HealthCodeContact.CodeView view) {
|
||||
public void attachView(@NonNull FamilySpaceContact.CodeView view) {
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@@ -63,11 +63,14 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
|
||||
private FragmentManager mFragmentManager;
|
||||
private FragmentTransaction mFragmentTransaction;
|
||||
|
||||
private ScaleCircleNavigator scaleCircleNavigator;
|
||||
private BaseFragmentPagerAdapter mBaseFragmentPagerAdapter;
|
||||
|
||||
private List<Fragment> mFragments;
|
||||
private CustomFragment mCustomFragment;
|
||||
private SecondFragment mSecondFragment;
|
||||
|
||||
private boolean is_twoscreen = false;
|
||||
private int appListIndex = 1;
|
||||
private int defaultCurrent = 0;
|
||||
|
||||
@@ -5,14 +5,13 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||
import com.qweather.sdk.view.QWeather;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.manager.AmapManager;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
@@ -58,11 +57,7 @@ public class WeatherPresenter implements WeatherContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getLocation() {
|
||||
BDLocation bdLocation = AmapManager.getInstance().getNowMapLocation();
|
||||
String location = "未知";
|
||||
if (bdLocation != null) {
|
||||
location = bdLocation.getCity() + "\t" + bdLocation.getDistrict();
|
||||
}
|
||||
String location = RemoteManager.getInstance().getCityDistrict();
|
||||
mView.setLocation(location);
|
||||
}
|
||||
|
||||
@@ -78,7 +73,7 @@ public class WeatherPresenter implements WeatherContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getWeather() {
|
||||
QWeather.getWeather7D(mContext, AmapManager.getInstance().getLocation(), new QWeather.OnResultWeatherDailyListener() {
|
||||
QWeather.getWeather7D(mContext, RemoteManager.getInstance().getLocationTude(), new QWeather.OnResultWeatherDailyListener() {
|
||||
@Override
|
||||
public void onError(Throwable throwable) {
|
||||
Log.e("getWeather", "onError: " + throwable.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user