You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement HtcAlertDialog for Teeter
This commit is contained in:
@@ -5,6 +5,7 @@ import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@@ -171,4 +172,6 @@ public class Dialog implements Window.Callback, DialogInterface {
|
||||
public void setOnShowListener(OnShowListener onShowListener) {
|
||||
this.onShowListener = onShowListener;
|
||||
}
|
||||
|
||||
public void setCancelMessage(Message msg) {}
|
||||
}
|
||||
|
||||
50
src/api-impl/com/htc/widget/HtcAlertDialog.java
Normal file
50
src/api-impl/com/htc/widget/HtcAlertDialog.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.htc.widget;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
||||
public class HtcAlertDialog extends AlertDialog {
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private HtcAlertDialog dialog;
|
||||
|
||||
public Builder(Context context) {
|
||||
dialog = new HtcAlertDialog(context);
|
||||
}
|
||||
|
||||
public Builder setIcon(int icon) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTitle(int title) {
|
||||
dialog.setTitle(dialog.getContext().getText(title));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessage(int message) {
|
||||
dialog.setMessage(dialog.getContext().getString(message));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositiveButton(int text, DialogInterface.OnClickListener listener) {
|
||||
dialog.setButton(DialogInterface.BUTTON_POSITIVE, dialog.getContext().getText(text), listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNegativeButton(int text, DialogInterface.OnClickListener listener) {
|
||||
dialog.setButton(DialogInterface.BUTTON_NEGATIVE, dialog.getContext().getText(text), listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
public HtcAlertDialog create() {
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
|
||||
public HtcAlertDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -586,6 +586,7 @@ srcs = [
|
||||
'com/google/android/vending/licensing/Policy.java',
|
||||
'com/android/server/am/DumpHeapProvider.java',
|
||||
'com/htc/util/htcresutil/resutil.java',
|
||||
'com/htc/widget/HtcAlertDialog.java',
|
||||
'javax/microedition/khronos/egl/EGL.java',
|
||||
'javax/microedition/khronos/egl/EGL10.java',
|
||||
'javax/microedition/khronos/egl/EGL11.java',
|
||||
|
||||
Reference in New Issue
Block a user