|
@@ -1,17 +1,22 @@
|
|
package com.wdkl.callingbed2.widget.loading;
|
|
package com.wdkl.callingbed2.widget.loading;
|
|
|
|
|
|
|
|
|
|
|
|
+import android.content.Intent;
|
|
import android.graphics.drawable.AnimationDrawable;
|
|
import android.graphics.drawable.AnimationDrawable;
|
|
|
|
+import android.provider.Settings;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
+import android.widget.Toast;
|
|
|
|
|
|
|
|
+import com.wdkl.callingbed2.MyApplication;
|
|
import com.wdkl.callingbed2.R;
|
|
import com.wdkl.callingbed2.R;
|
|
|
|
+import com.wdkl.callingbed2.util.AutoRebootUtil;
|
|
|
|
|
|
|
|
|
|
-public class VaryViewHelperController {
|
|
|
|
|
|
+public class VaryViewHelperController implements View.OnLongClickListener, View.OnClickListener {
|
|
|
|
|
|
private IVaryViewHelper helper;
|
|
private IVaryViewHelper helper;
|
|
|
|
|
|
@@ -36,6 +41,7 @@ public class VaryViewHelperController {
|
|
againBtn.setOnClickListener(onClickListener);
|
|
againBtn.setOnClickListener(onClickListener);
|
|
}
|
|
}
|
|
helper.showLayout(layout);
|
|
helper.showLayout(layout);
|
|
|
|
+ layout.setOnLongClickListener(this);
|
|
}
|
|
}
|
|
|
|
|
|
public void showNetworkError(View.OnClickListener onClickListener,String str) {
|
|
public void showNetworkError(View.OnClickListener onClickListener,String str) {
|
|
@@ -47,6 +53,8 @@ public class VaryViewHelperController {
|
|
againBtn.setOnClickListener(onClickListener);
|
|
againBtn.setOnClickListener(onClickListener);
|
|
}
|
|
}
|
|
helper.showLayout(layout);
|
|
helper.showLayout(layout);
|
|
|
|
+ layout.setOnLongClickListener(this);
|
|
|
|
+ tvMac.setOnClickListener(this);
|
|
}
|
|
}
|
|
|
|
|
|
public void showEmpty(String emptyMsg) {
|
|
public void showEmpty(String emptyMsg) {
|
|
@@ -56,14 +64,34 @@ public class VaryViewHelperController {
|
|
textView.setText(emptyMsg);
|
|
textView.setText(emptyMsg);
|
|
}
|
|
}
|
|
helper.showLayout(layout);
|
|
helper.showLayout(layout);
|
|
|
|
+ layout.setOnLongClickListener(this);
|
|
|
|
+ textView.setOnClickListener(this);
|
|
}
|
|
}
|
|
|
|
|
|
public void showLoading() {
|
|
public void showLoading() {
|
|
View layout = helper.inflate(R.layout.view_loading_loading);
|
|
View layout = helper.inflate(R.layout.view_loading_loading);
|
|
helper.showLayout(layout);
|
|
helper.showLayout(layout);
|
|
|
|
+ layout.setOnLongClickListener(this);
|
|
}
|
|
}
|
|
|
|
|
|
public void restore() {
|
|
public void restore() {
|
|
helper.restoreView();
|
|
helper.restoreView();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean onLongClick(View view) {
|
|
|
|
+ MyApplication.getAppContext().startActivity(new Intent(Settings.ACTION_SETTINGS));
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ Intent intent = AutoRebootUtil.getNewAppIntent(MyApplication.getAppContext());
|
|
|
|
+ if (intent != null) {
|
|
|
|
+ Toast.makeText(MyApplication.getAppContext(), "新V3系统app已安装,即将启动...", Toast.LENGTH_SHORT).show();
|
|
|
|
+ MyApplication.getAppContext().startActivity(intent);
|
|
|
|
+ } else {
|
|
|
|
+ Toast.makeText(MyApplication.getAppContext(), "新V3系统app未安装,请先安装新系统app...", Toast.LENGTH_SHORT).show();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|