114 lines
4.2 KiB
Java
114 lines
4.2 KiB
Java
package com.eamobile.views;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Context;
|
|
import android.content.DialogInterface;
|
|
import android.view.KeyEvent;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.ScrollView;
|
|
import android.widget.TextView;
|
|
import com.eamobile.DownloadActivityInternal;
|
|
import com.eamobile.Language;
|
|
|
|
public class InvalidAssetVersionView extends CustomView {
|
|
Dialog dialog;
|
|
Button exitBtn;
|
|
LinearLayout mainLayout;
|
|
|
|
public InvalidAssetVersionView(Context context) {
|
|
super(context);
|
|
this.context = context;
|
|
}
|
|
|
|
private void createContent(View view) {
|
|
this.dialog = new Dialog(this.context);
|
|
this.dialog.setCancelable(true);
|
|
this.dialog.setCanceledOnTouchOutside(false);
|
|
this.dialog.requestWindowFeature(1);
|
|
this.mainLayout = new LinearLayout(this.context);
|
|
this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f));
|
|
this.mainLayout.setOrientation(1);
|
|
this.mainLayout.setGravity(16);
|
|
addTitle(this.context, this.mainLayout, Language.getString(42));
|
|
LinearLayout linearLayout = new LinearLayout(this.context);
|
|
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f));
|
|
linearLayout.setOrientation(1);
|
|
linearLayout.setGravity(16);
|
|
ScrollView scrollView = new ScrollView(this.context);
|
|
scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f));
|
|
scrollView.setForegroundGravity(16);
|
|
TextView textView = new TextView(this.context);
|
|
textView.setClickable(false);
|
|
textView.setCursorVisible(false);
|
|
textView.setPadding(10, 10, 10, 10);
|
|
textView.setTextSize(1, 16.0f);
|
|
textView.setText(Language.getString(43));
|
|
scrollView.addView(textView);
|
|
LinearLayout linearLayout2 = new LinearLayout(this.context);
|
|
linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f));
|
|
linearLayout2.setPadding(5, 0, 5, 5);
|
|
linearLayout2.setOrientation(0);
|
|
linearLayout2.setGravity(80);
|
|
this.exitBtn = addButton(this.context, linearLayout2, Language.getString(6));
|
|
linearLayout.addView(scrollView);
|
|
this.mainLayout.addView(linearLayout);
|
|
this.mainLayout.addView(linearLayout2);
|
|
}
|
|
|
|
private void showContent(View view) {
|
|
this.exitBtn.setOnClickListener(new View.OnClickListener() {
|
|
/* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass1 */
|
|
|
|
public void onClick(View view) {
|
|
InvalidAssetVersionView.this.dialog.dismiss();
|
|
try {
|
|
DownloadActivityInternal.getMainActivity().startGameActivity(0);
|
|
} catch (Throwable th) {
|
|
}
|
|
}
|
|
});
|
|
this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
|
|
/* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass2 */
|
|
|
|
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
|
|
return i == 82 || i == 84;
|
|
}
|
|
});
|
|
this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
|
/* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass3 */
|
|
|
|
public void onCancel(DialogInterface dialogInterface) {
|
|
dialogInterface.dismiss();
|
|
DownloadActivityInternal.getMainActivity().startGameActivity(0);
|
|
}
|
|
});
|
|
this.dialog.setContentView(this.mainLayout);
|
|
this.dialog.show();
|
|
}
|
|
|
|
@Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView
|
|
public void clean() {
|
|
super.clean();
|
|
try {
|
|
this.dialog.dismiss();
|
|
} catch (Exception e) {
|
|
}
|
|
}
|
|
|
|
@Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView
|
|
public void init() {
|
|
super.init();
|
|
createContent(this);
|
|
showContent(this);
|
|
}
|
|
|
|
@Override // com.eamobile.views.CustomView
|
|
public void resume() {
|
|
if (this.dialog != null) {
|
|
showContent(this);
|
|
}
|
|
}
|
|
}
|