android-styles

Remove black background on custom dialog

99封情书 提交于 2019-12-02 16:11:58
I want to remove the black background on custom dialog as shown in the picture. I'm sure the black background was from the dialog, not from app's background. ; AlertDialog code public class MyAlertDialog extends AlertDialog { public MyAlertDialog(Context context) { super(context); } public MyAlertDialog(Context context, int theme) { super(context, theme); } } Activity code public void showMyDialogOK(Context context, String s, DialogInterface.OnClickListener OkListener) { MyAlertDialog myDialog = new MyAlertDialog(context, R.style.MyDialog2); myDialog.setTitle(null); myDialog.setMessage(s);

Example and explanation: Android (Studio) Login Activity Template generated activity

好久不见. 提交于 2019-12-02 13:59:48
I wanted to implement a login form in my app, so I tried to use the code generated by the Android Studio Wizard for a new Activity of type Login Form. i think that the code generated by Eclipse is almost the same. Unfortunately, the generated code did not provide the expected result: I created a nice simple login form, but with correct or wrong password, it does not move from the login form. Also I noticed that no "Register" form was created. After looking a bit, and analyzing the code, I finally got it working :) See my response below. Cedric Simon Step 1: Make Login successful and advance to

Set a consistent theme for all the editTexts in Android

。_饼干妹妹 提交于 2019-12-02 01:30:38
问题 I have finished making my app. Now, I want to reset all my editTexts to have the layout width as fill parent instead of wrap content. android:layout_width="fill_parent" while currently all my editTexts are android:layout_width="wrap_content" Is there any way i can do this in a style xml file, instead of individually in each layout? I currently have this as my styles.xml <style name="AppTheme" parent="android:Theme.Light"> <item name="android:fontFamily">Verdana</item> <item name="android

Set a consistent theme for all the editTexts in Android

佐手、 提交于 2019-12-01 20:51:28
I have finished making my app. Now, I want to reset all my editTexts to have the layout width as fill parent instead of wrap content. android:layout_width="fill_parent" while currently all my editTexts are android:layout_width="wrap_content" Is there any way i can do this in a style xml file, instead of individually in each layout? I currently have this as my styles.xml <style name="AppTheme" parent="android:Theme.Light"> <item name="android:fontFamily">Verdana</item> <item name="android:editTextStyle">@style/EditTextStyle</item> </style> <style name="EditTextStyle" parent="@android:style

Extract Support Library layout attributes into styles

拜拜、爱过 提交于 2019-12-01 18:37:13
I am extracting styles for views which are inside Support Library's GridLayout . Therefore, I have both attributes from the "android" namespace, e.g. android:layout_marginLeft="8dp" and attributes from the "app" ( http://schemas.android.com/apk/res-auto ) one, e.g. app:layout_columnSpan="2" . First, Android Studio doesn't recognize the attributes from "app" when I try to extract the attributes as a style. Second, it doesn't seem that extracting them into styles.xml manually brings any effect to the actual layout. So, is it possible to extract the Support Library attributes as a separate style,

Getting AppCompat does not support the current theme features exception after upgrading to version AppCompat v22.1.0 issue

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 18:27:12
问题 Previously i was using AppCompat with version 21.1.2 in my project for the purpose of material design toggle with toolbar. But after upgrading to AppCompat v22.1.0, my app has started working weird. I even tried some of the solutions like as follows <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> Also applying parent theme as <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> But none of the above solutions was not helpful for me. So kindly please

Getting AppCompat does not support the current theme features exception after upgrading to version AppCompat v22.1.0 issue

久未见 提交于 2019-12-01 18:17:30
Previously i was using AppCompat with version 21.1.2 in my project for the purpose of material design toggle with toolbar. But after upgrading to AppCompat v22.1.0, my app has started working weird. I even tried some of the solutions like as follows <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> Also applying parent theme as <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> But none of the above solutions was not helpful for me. So kindly please help me by your tips and suggestions to overcome my issue which i am currently facing. I am also posting

Setting styles of programmatically added Views

送分小仙女□ 提交于 2019-12-01 18:06:30
In my code, I add input elements like radioButtons, checkboxes etc to my Layout programmatically. The problem is, that the style of those elements is not the default style that you would get, when you would add let's say a radioButton via xml. (It looks really white and almost see-through on a white application background. A bit like it is transparent) Also, the EditText elements I'm adding have the same style and if you type something in them, the text is too big and overlaps the text line a bit. So I guess it all comes down to somehow giving those elements their default style, like they look

Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'

送分小仙女□ 提交于 2019-12-01 14:59:19
问题 I am getting this error in styles.xml: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. In manifest: <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" /> Android Sdk Manager: I am updated all the api 21 and extras. In Order and Export : values-v21/styles.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:Theme.Material.Light"> <item name="android:colorPrimary">@color

Hide ActionBar title just for one activity

烂漫一生 提交于 2019-12-01 13:25:22
If I apply theme for whole application it hides ActionBar title successfully: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> <style name="ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"> <item name="android:displayOptions">showHome|useLogo</item> </style> </resources> assign in manifest : <application android:name="myapp" android:allowBackup="true" android:icon="@drawable/action_bar_icon" android:label="@string/app_name"