use of cn.cqautotest.sunnybeach.aop.DebugLog in project SunnyBeach by anjiemo.
the class ImageSelectActivity method start.
@DebugLog
@Permissions({ Permission.MANAGE_EXTERNAL_STORAGE })
public static void start(BaseActivity activity, int maxSelect, OnPhotoSelectListener listener) {
if (maxSelect < 1) {
// 最少要选择一个图片
throw new IllegalArgumentException("are you ok?");
}
Intent intent = new Intent(activity, ImageSelectActivity.class);
intent.putExtra(IntentKey.AMOUNT, maxSelect);
activity.startActivityForResult(intent, (resultCode, data) -> {
if (listener == null || data == null) {
return;
}
ArrayList<String> list = data.getStringArrayListExtra(IntentKey.IMAGE);
if (list == null || list.isEmpty()) {
listener.onCancel();
return;
}
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
if (!new File(iterator.next()).isFile()) {
iterator.remove();
}
}
if (resultCode == RESULT_OK && !list.isEmpty()) {
listener.onSelected(list);
return;
}
listener.onCancel();
});
}
use of cn.cqautotest.sunnybeach.aop.DebugLog in project SunnyBeach by anjiemo.
the class LoginActivity method start.
@DebugLog
public static void start(Context context, String phone, String password) {
Intent intent = new Intent(context, LoginActivity.class);
intent.putExtra(IntentKey.PHONE, phone);
intent.putExtra(IntentKey.PASSWORD, password);
if (!(context instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);
}
use of cn.cqautotest.sunnybeach.aop.DebugLog in project SunnyBeach by anjiemo.
the class PasswordResetActivity method start.
@DebugLog
public static void start(Context context, String phone, String code) {
Intent intent = new Intent(context, PasswordResetActivity.class);
intent.putExtra(IntentKey.PHONE, phone);
intent.putExtra(IntentKey.CODE, code);
if (!(context instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);
}
use of cn.cqautotest.sunnybeach.aop.DebugLog in project SunnyBeach by anjiemo.
the class VideoSelectActivity method start.
@DebugLog
@Permissions({ Permission.MANAGE_EXTERNAL_STORAGE })
public static void start(BaseActivity activity, int maxSelect, OnVideoSelectListener listener) {
if (maxSelect < 1) {
// 最少要选择一个视频
throw new IllegalArgumentException("are you ok?");
}
Intent intent = new Intent(activity, VideoSelectActivity.class);
intent.putExtra(IntentKey.AMOUNT, maxSelect);
activity.startActivityForResult(intent, (resultCode, data) -> {
if (listener == null || data == null) {
return;
}
ArrayList<VideoBean> list = data.getParcelableArrayListExtra(IntentKey.VIDEO);
if (list == null || list.isEmpty()) {
listener.onCancel();
return;
}
Iterator<VideoBean> iterator = list.iterator();
while (iterator.hasNext()) {
if (!new File(iterator.next().getVideoPath()).isFile()) {
iterator.remove();
}
}
if (resultCode == RESULT_OK && !list.isEmpty()) {
listener.onSelected(list);
return;
}
listener.onCancel();
});
}
use of cn.cqautotest.sunnybeach.aop.DebugLog in project SunnyBeach by anjiemo.
the class BrowserActivity method start.
@CheckNet
@DebugLog
public static void start(Context context, String url) {
if (TextUtils.isEmpty(url)) {
return;
}
Intent intent = new Intent(context, BrowserActivity.class);
intent.putExtra(IntentKey.URL, url);
// 加载非反馈界面
intent.putExtra(IntentKey.OTHER, false);
if (!(context instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);
}
Aggregations