mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-05-08 03:28:07 +03:00
add some methods needed for androidx dialogs
This commit is contained in:
parent
056b911637
commit
d2f28a5b21
7 changed files with 48 additions and 3 deletions
|
@ -3,6 +3,7 @@ package android.app;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Menu;
|
||||
|
@ -55,6 +56,7 @@ public class Dialog implements Window.Callback {
|
|||
|
||||
public void show() {
|
||||
System.out.println("totally showing the Dialog " + this + " right now, most definitely doing that");
|
||||
onCreate(null);
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -72,7 +74,12 @@ public class Dialog implements Window.Callback {
|
|||
}
|
||||
|
||||
public Window getWindow() {
|
||||
return new Window(this);
|
||||
return new Window(this) {
|
||||
@Override
|
||||
public void setContentView(View view) {
|
||||
Dialog.this.setContentView(view);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void setCanceledOnTouchOutside(boolean cancel) {}
|
||||
|
@ -85,8 +92,6 @@ public class Dialog implements Window.Callback {
|
|||
|
||||
@Override
|
||||
public void onContentChanged() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onContentChanged'");
|
||||
}
|
||||
@Override
|
||||
public boolean onCreatePanelMenu(int featureId, Menu menu) {
|
||||
|
@ -113,4 +118,8 @@ public class Dialog implements Window.Callback {
|
|||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onPanelClosed'");
|
||||
}
|
||||
|
||||
protected void onCreate (Bundle savedInstanceState) {
|
||||
System.out.println("- onCreate - Dialog!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,6 @@ public class Layout {
|
|||
public float getLineWidth(int line) {return 10;}
|
||||
|
||||
public TextPaint getPaint() {return new TextPaint();}
|
||||
|
||||
public int getEllipsisCount(int line) {return 0;}
|
||||
}
|
||||
|
|
|
@ -1598,4 +1598,8 @@ public class View extends Object {
|
|||
public void setAccessibilityLiveRegion(int mode) {}
|
||||
|
||||
public void invalidateOutline() {}
|
||||
|
||||
public int getMeasuredWidthAndState() {
|
||||
return measuredWidth;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -302,6 +302,8 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
public void setClipToPadding(boolean clipToPadding) {}
|
||||
|
||||
public static class LayoutParams {
|
||||
public static final int FILL_PARENT = -1;
|
||||
public static final int MATCH_PARENT = -1;
|
||||
|
|
|
@ -15,4 +15,12 @@ public abstract class AbsListView extends AdapterView {
|
|||
|
||||
public void setChoiceMode(int choiceMode) {}
|
||||
|
||||
public void setOnScrollListener(OnScrollListener onScrollListener) {}
|
||||
|
||||
public void setAdapter(ListAdapter adapter) {}
|
||||
|
||||
public void setItemChecked(int position, boolean value) {}
|
||||
|
||||
public interface OnScrollListener {}
|
||||
|
||||
}
|
||||
|
|
19
src/api-impl/android/widget/Space.java
Normal file
19
src/api-impl/android/widget/Space.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class Space extends View {
|
||||
|
||||
public Space(Context context) {
|
||||
super(context);
|
||||
haveComplexMeasure = true;
|
||||
}
|
||||
|
||||
public Space(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
haveComplexMeasure = true;
|
||||
}
|
||||
|
||||
}
|
|
@ -429,6 +429,7 @@ hax_jar = jar('hax', [
|
|||
'android/widget/Scroller.java',
|
||||
'android/widget/ScrollView.java',
|
||||
'android/widget/SeekBar.java',
|
||||
'android/widget/Space.java',
|
||||
'android/widget/Spinner.java',
|
||||
'android/widget/SpinnerAdapter.java',
|
||||
'android/widget/Switch.java',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue