fengdai / alertdialogpro Goto Github PK
View Code? Open in Web Editor NEW[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.
License: Other
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.
License: Other
I use this library for MTG Familiar. A user using an Xperia T reported the following dialog with strangely offset checkboxes:
The dialog is built using this code:
mRarityDialog = new AlertDialogPro
.Builder(this.getActivity())
.setTitle(R.string.search_rarities)
.setMultiChoiceItems(mRarityNames, mRarityChecked, multiChoiceClickListener)
.setPositiveButton(R.string.dialog_ok, clickListener)
.create();
Thank you for looking into this UI issue.
how can we open alert dialog in full screen.? i want to show it in custom view.
It seems that the latest version published on maven, is not updated:
Some classes, like ProgressBarCompat are missing.
Could you fix it please?
Thanks in advance.
Marcello
Hello and thanks for your great work.
I wanted to integrate your library for Holo styled dialogs in an existing project using AppCompat version 20 (pre-material). I don't want to migrate this project to AppCompat v21 because of the visual changes it implies: drawable tinting, new default colors, deprecated features in the ActionBar, ...
However I couldn't integrate AlertDialogPro-theme-holo at all because the core relies on Theme.AppCompat.Dialog. Could you adapt the library to make it inherit from the native themes directly and remove this dependency in order to make it compatible with v20 as well, or do you target v21 and Material Design only from now on?
Use setView(int layoutResId)
to set a custom view which contains a single EditText. The EditText can't be clicked to get focus.
I've just found this:
in core library, "values/themes.xml" has this :
<style name="AlertDialogProTheme" parent="android:Theme.Dialog"></style>
<style name="AlertDialogProTheme.Light" parent="android:Theme.Dialog"></style>
and "values-v11/themes.xml" has this:
<style name="AlertDialogProTheme" parent="android:Theme.Holo.Dialog">...
<style name="AlertDialogProTheme.Light" parent="android:Theme.Holo.Light.Dialog">...
in material library, "values/themes.xml" has this:
<style name="AlertDialogProTheme" parent="Theme.AppCompat.Dialog"></style>
<style name="AlertDialogProTheme.Light" parent="Theme.AppCompat.Light.Dialog"></style>
Is it in order to avoid making the dialog material by using the support library?
If so, since material is newer, shouldn't just the holo library change it to something else, instead of the material library?
I mean, you could have just the second declaration (in the material) and put it into the core library, and set a different declaration in the Holo library.
Is it because the core library doesn't really use the support library?
I'm not even sure if the Holo library is needed anymore, now that the support library goes more material...
What do you think?
support RTL, by adding "...start" and "...end" attributes when needed.
Hello,
Thank you for this nice library!
Is it possible to use AlertDialogPro with ListPreference widget?
It would be awesome to use in settings fragments...
Stéphane.
in support v7 23.1.1 android.support.v7.internal become private how to solve this problem?
Problem:
The adpListItemBackground attribute does not style the background of listitems.
Possible cause:
The adpListItemBackground attribute is not being used in the select_dialog_item_holo.xml file
Note: This could be expected behavior but it seems over kill to define your own list item layout when you just want to style the background.
Corrected code (this fixes my problem):
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:minHeight="?adpListItemHeight"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:background="?adpListItemBackground"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?adpListItemTextColor" />
Is it possible to change circular progress bar color with styles?
Tried to add this to my theme:
<item name="colorControlActivated">@color/black</item>
but this doesn't change the color (I got the hint by looking into ProgressBarCompat.java, line 25).
It works by programmatically setting indeterminate drawable like this:
progressDialog.setIndeterminateDrawable(new CircularAnimatedDrawable(activity.getResources().getColor(R.color.black), 4));
But it would be nicer if we had solution to do this with styles.
Hi,
I'm using this great library in my application.
I'm getting the following crash report on a Lenovo A916 with Android 4.4, when showing a indeterminate ProgressDialogPro:
android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:1133) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2381) at android.content.res.Resources.getLayout(Resources.java:949) at android.view.LayoutInflater.inflate(LayoutInflater.java:395) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:305) at com.alertdialogpro.internal.AlertController.installContent(Unknown Source) at com.alertdialogpro.AlertDialogPro.onCreate(Unknown Source) at com.alertdialogpro.ProgressDialogPro.onCreate(Unknown Source) at android.app.Dialog.dispatchOnCreate(Dialog.java:361) at android.app.Dialog.show(Dialog.java:262) at it.cammino.risuscito.PaginaRenderActivity.cmdPrepare(Unknown Source) at it.cammino.risuscito.PaginaRenderActivity.access$900(Unknown Source) at it.cammino.risuscito.PaginaRenderActivity$7.onClick(Unknown Source) at android.view.View.performClick(View.java:4463) at android.view.View$PerformClick.run(View.java:18772) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5292) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) at dalvik.system.NativeStart.main(Native Method)
My code is just:
mp3Dialog = new ProgressDialogPro(PaginaRenderActivity.this); mp3Dialog.setMessage(getResources().getString(R.string.wait)); mp3Dialog.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { setRequestedOrientation(prevOrientation); } }); mp3Dialog.show();
I set correctly the theme in my settings:
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light.NoActionBar"> .. <item name="alertDialogProTheme">@style/AppTheme.FlavoredMaterialLight</item> </style> <style name="AppTheme.FlavoredMaterialLight" parent="Theme.AlertDialogPro.Material.Light"> <item name="colorAccent">@color/theme_accent</item> </style>
It seems that the error occurs only on this particual device, as I tested my application on many Kitkat devices and this crash never occurred.
Any help?
Thanks in advance.
Marcello
Now the support library has support for AlertDialogs :
http://android-developers.blogspot.co.il/2015/04/android-support-library-221.html
However, it does miss some stuff, like the ProgressDialog and maybe some themes too.
Please check it out.
Can we use these Lib. im my sample app. that uses SherlockActionBar ?
expecting +ve rply...
I just get this message:
"
Error:Execution failed for task ':alertdialogpro-core:processReleaseResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files (x86)\Android\android-sdk\build-tools\21.0.0\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-sdk\platforms\android-21\android.jar -M C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release\AndroidManifest.xml -S C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\res\release -A C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release\assets -m -J C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\generated\source\r\release --custom-package com.alertdialogpro --non-constant-id -0 apk --output-text-symbols C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release
Error Code:
-1073741819
"
How come? It worked fine in the past...
Hello! When I'm trying to include the library into my project, I'm getting an error:
:alertdialogpro-core:processDebugResources FAILED
FAILURE: Build failed with an exception.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Android\sdk\build-tools\21.0.0\aapt.exe package -f --no-crunch -I C:\Android\sdk\platforms\android-21\android.jar -M C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug\AndroidManifest.xml -S C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\res\debug -A C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug\assets -m -J C:\Android\Projects\MealControl\alertdialogpro-core\build\generated\source\r\debug --debug-mode --custom-package com.alertdialogpro --non-constant-id -0 apk --output-text-symbols C:\Android\Projects\MealControl\alertdialogpro-core\build\intermediates\bundles\debug
Error Code:
-1073741819
How to slove this problem?
Failed to resolve: com.github.fengdai:alertdialogpro-theme-material:0.2.6
I am wondering if there is a way to change the typefaces of all the texts that appear in the dialogs.
Thanks in advance.
How do I use this library?
Can you please post a sample code of how to create an alertDialog ?
Does it work well on Gingerbread?
this is my code
`package com.roselism.listdialog_alpha;
import com.alertdialogpro.AlertDialogPro;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AlertDialogPro.Builder builder = new AlertDialogPro.Builder(this);
builder.setIcon(R.drawable.adp_item_background_material_dark).
setTitle("Title").
setMessage("Message Body").
setNeutralButton("Neutral", null).
setPositiveButton("Positive", null).
setNegativeButton("Negative", null).
show();
}
}
and this is what i get, What shoud i do ?
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
`
Maybe have "adp__" as a prefix for each resource and file.
Also, for the core library, you could use "adp_core__" , for holo, you could use "adp_holo__", and for material, you could use "adp_mat__"
I have a notification that I wish to open a transparent activity which will also show a dialog.
What should I change in the themes/code in order to support this?
In the past, I think this is what I've done (based on this link: http://stackoverflow.com/q/18337533 ) :
final Window window=dialog.getWindow();
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT);
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
But it doesn't work anymore here.
Also, since the dialog doesn't have any border, it can blend with the activity behind it, so I think I should avoid having a totally transparent activity.
Any plans to implement your version of DatePickerDialog (also extends AlertDialog)?
below is my code:
private void showCustomViewDialog() {
createAlertDialogBuilder()
.setTitle(getResources().getString(R.string.set_path))
.setView(getLayoutInflater().inflate(R.layout.path_dialog, null))
.setNegativeButton("Cancel", new PathClickedListener("Cancel"))
.setPositiveButton("Save", null).show();
TextView tvPath = (TextView)findViewById(R.id.tvPDPath);
tvPath.setText("Test");
}
i am getting nullpointerexception at this line:
tvPath.setText("Test");
Caused by: java.lang.NoClassDefFoundError: android.support.v7.internal.text.AllCapsTransformationMethod at com.alertdialogpro.material.ButtonCompat.(ButtonCompat.java:30)
When setting textAllCaps to false, the problems does not occur since the ButtonCompat does not apply the transformation.
Update: Was just my fault - please delete the issue
Hi,
your AlertDialogPro is a fine thing, but I have problems with integrating it in my App. (I get a RessourceNotFoundException).
Maybe because I am using Appcompat as parent App Theme?
Thx
@color/link_text_material_light
Error:(88, 45) No resource found that matches the given name (at 'android:textColorLink' with value '@color/link_text_material_light').
i have a error in alertdialogpro-theme-materia when compile using 23 SDK version
If I not modify theme and not modify code, just replace AlertDialog to AlertDialogPro, my app crashes with this exception:
12-02 15:41:30.870 7189-7189/com.omihaz.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.omihaz.app, PID: 7189
android.content.res.Resources$NotFoundException: Resource ID #0x0
This occurs because by default @null
And
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at com.alertdialogpro.internal.AlertController.installContent(AlertController.java:193)
Cannot inflate null resource.
You need provide some base theme as default.
Sadly, Google is officially stopping Eclipse support, so I tried to migrate my app to Android-Studio.
Now I get this error, which I'm not sure if it's because of Gradle or the library, or maybe Android Studio :
Error:Execution failed for task ':appManager:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\android\build-tools\21.1.1\dx.bat --dex --no-optimize --output D:\android\Android studio Projects\AppManager\appManager\build\intermediates\dex\debug --input-list=D:\android\Android studio Projects\AppManager\appManager\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/alertdialogpro/AlertDialogPro$Builder;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302)
at com.android.dx.command.dexer.Main.run(Main.java:245)
at com.android.dx.command.dexer.Main.main(Main.java:214)
at com.android.dx.command.Main.main(Main.java:106)
Can you please help on this?
After choosing to analyze the code, I see a weird error for the file "adp_select_dialog_material.xml", which is" Unknown attribute class" for class="com.alertdialogpro.internal.AlertController$RecycleListView" .
I don't get it...
if i user compile 'com.android.support:appcompat-v7:23.1.1' with alertdialogpro like this :
compile 'com.github.fengdai:alertdialogpro-theme-material:0.2.5'
compile 'com.android.support:appcompat-v7:23.1.1'
it raise Caused by: java.lang.NoClassDefFoundError: android.support.v7.internal.widget.TintTypedArray
when do android.view.InflateException: Binary XML file line #2: Error inflating class com.alertdialogpro.material.CheckedTextViewCompat
Since I am willing to use only the material design, is it possible to avoid using the rest of the files (of Holo) ?
Is it possible for me to merge the 2 libraries, and use a single one?
If so, please show all the steps I need to perform.
Remove unused files "list_divider_material_light.xml" and "list_divider_material_dark.xml".
Hello! I have some problems with the library.
Firstly, I've used gradle for adding yours library to my project:
compile 'com.github.fengdai:alertdialogpro-theme-material:0.2.0'
compile 'com.github.fengdai:alertdialogpro-core:0.2.0'
After that I've added into my style.xml:
<item name="alertDialogProTheme">@style/Theme.AlertDialogPro.Material</item>
Then I've used this example of code in my class:
AlertDialogPro.Builder builder = new AlertDialogPro.Builder(getContext());
builder.setIcon(R.drawable.icon).
setTitle("Title").
setMessage("Message Body").
setNeutralButton("Neutral", null).
setPositiveButton("Positive", null).
setNegativeButton("Negative", null).
show();
But I 'm getting an Exception when I'm trying to run the project:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output
C:\Android\Releases\MealControl\app\build\intermediates\dex\debug --input-list=C:\Android\Releases\MealControl\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code: 2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Lcom/nineoldandroids/animation/Animator$AnimatorListener;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
When I'm trying to use version 0.1.0:
compile 'com.github.fengdai:alertdialogpro-theme-material:0.1.0'
compile 'com.github.fengdai:alertdialogpro-core:0.1.0'
I'm getting an Exception:
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1131)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2327)
at android.content.res.Resources.getLayout(Resources.java:947)
at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:297)
at com.alertdialogpro.internal.AlertController.installContent(AlertController.java:193)
at com.alertdialogpro.AlertDialogPro.onCreate(AlertDialogPro.java:166)
at android.app.Dialog.dispatchOnCreate(Dialog.java:369)
at android.app.Dialog.show(Dialog.java:270)
at com.alertdialogpro.AlertDialogPro$Builder.show(AlertDialogPro.java:774)
at bitfrom.me.mealcontrol.views.RationFragment$1.onClick(RationFragment.java:53)
at com.gc.materialdesign.views.Button.makeCircle(Button.java:123)
at com.gc.materialdesign.views.ButtonRectangle.onDraw(ButtonRectangle.java:128)
When I leave only core:
compile 'com.github.fengdai:alertdialogpro-core:0.2.0'
I'm getting the same android.content.res.Resources$NotFoundException: Resource ID #0x0
Exception.
Thank you for attention.
how can we change color of text of positive and negative buttons.?
Hi,
I'm trying to change text color for positive button. It works well with Material theme but doesn't affect Holo theme.
My styles.xml:
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
...
<item name="alertDialogProTheme">@style/CustomAlertDialog</item>
</style>
<style name="CustomAlertDialog" parent="Theme.AlertDialogPro.Material.Light">
<item name="adpButtonBarPositiveButtonStyle">@style/CustomDialogPositiveButton</item>
</style>
<style name="CustomDialogPositiveButton" parent="Widget.AlertDialogPro.Material.Light.Button">
<item name="android:textColor">@color/bittersweet</item>
</style>
The issue is that in the sample, when choosing "Show single-choice list" via the Android Lollipop emulator, it needs double tapping in order to choose an item, compared to once for the normal dialog.
I can't put videos and other files here, so here's a link to both the video and the sample project, after some changes had to be made to show the native dialog:
https://drive.google.com/file/d/0B-PZZGk2vPohZ1lsUWkwNjBuRDA
Do note that on Kitkat (and maybe older) version it works fine. Only on the emulator (with Lollipop) it has this issue. Since I don't have Lollipop on a real device, I have no idea if it works fine there or not.
Also ignore the blinking. It's emulator issues.
import android.support.v7.internal.widget.TintManager;
import android.support.v7.internal.widget.TintTypedArray;
have error with 23.2.1 hope upgrade to compile 'com.android.support:appcompat-v7:23.2.1'
Compare those:
Android Lollipop theme:
The color of the text isn't the same, and there are dividers in the library itself, while on Lollipop there isn't .
Same happens when using a dark theme.
I also think the title is supposed to be a bit to the right.
Also, I think the layout file "alert_dialog_material.xml" (and others) can be a bit more optimized, as Lint suggests.
Some of its possible optimizations:
Hi!
I am experiencing an exception that only occurs on api 21 or higher:
06-04 10:22:07.076 3484-3484/test.testap E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: test.testapp, PID: 3484
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1233)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2598)
at android.content.res.Resources.getLayout(Resources.java:1049)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at com.alertdialogpro.internal.AlertController.installContent(AlertController.java:193)
at com.alertdialogpro.AlertDialogPro.onCreate(AlertDialogPro.java:166)
at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
at android.app.Dialog.show(Dialog.java:274)
at com.alertdialogpro.AlertDialogPro$Builder.show(AlertDialogPro.java:774)
at test.testapp.MyResultsActivity.onOptionsItemSelected(MyResultsActivity.java:164)
This is how I use AlertdialogPro:
AlertDialogPro.Builder builder = new AlertDialogPro.Builder(this);
builder.setTitle("Choose race");
builder.setCancelable(true);
builder.setView(R.layout.choose_race_dialog);
builder.show();
So to clarify on Api 19 this works wonderful, I get a clean Lollipop-style dialog. But it crashes on Lollipop.
I style it like:
<style name="My.Theme" parent="Theme.AppCompat.Light">
....
<item name="alertDialogProTheme">@style/MyAlertDialogProTheme</item>
....
</style>
<style name="MyAlertDialogProTheme" parent="Theme.AlertDialogPro.Material.Light">
<item name="android:windowBackground">@drawable/dialog_background</item>
</style>
I have also tried to not use any particular styling in my theme but that does not seem to make any difference.
I included the library in my project through Gradle like this:
dependencies {
compile 'com.github.fengdai:alertdialogpro-theme-material:0.2.3'
}
Any ideas to why I might get this exception?
Would make using this much easier if I could just add it as a dependency in build.gradle
and control which version I use.
import android.support.v7.internal.widget.TintManager;
import android.support.v7.internal.widget.TintTypedArray;
have error with 23.1.1 hope upgrade to compile 'com.android.support:appcompat-v7:23.1.1'
I did create a Dialog using alert dialog pro, but it seems there has no attribute can change the style of the edittext's accent color.
I found this library just today and I really like it! I'm probably gonna use it in my next project ;) The code style is way beter than the library I was using before (android-styled-dialogs). Great work!
But I found a small issue when I tried to create a AlertDialog with just an EditText inside it. But the resulting dialog shows unwanted space underneath the EditText. After digging around in the code base I found that the FrameLayout hosting the custom view has a minHeight parameter.
Shouldn't this minHeight be removed? When I removed the parameter everything worked just fine.
This is the code I use:
<FrameLayout
android:id="@+id/customPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<FrameLayout
android:id="@+id/custom"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
Removed line:
android:minHeight="64dp"
As in subject..
This may be a new feature..
I've tried setting a custom view as a listView, and filled it with items.
I've also added OK,CANCEL buttons.
On normal sized screens, it worked fine.
On a small screen (QVGA) with Android 2.3 , it didn't show the buttons, only the listView.
Here's a snippet code:
final AlertDialogPro.Builder builder=new AlertDialogPro.Builder(activity,...);
builder.setTitle(...);
builder.setNeutralButton(android.R.string.cancel,null);
final String[] itemsStr=new String[items.size()];
// <= fill the array with strings
final ArrayAdapter adapter=new ArrayAdapter(activity,android.R.layout.simple_list_item_multiple_choice,itemsStr);
final ListView listView=new ListView(activity);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
listView.setAdapter(adapter);
builder.setPositiveButton(android.R.string.ok,new OnClickListener() ...);
builder.setView(listView);
builder.show();
What should I do? There isn't such a thing as "setMaxHeight" ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.