android-gui

How can I delete my list row by clicking on button in each row of the LISTVIEW

天涯浪子 提交于 2019-12-24 11:36:36
问题 I have a list view with custom array adapter. I want to get delete the item when delete button clicked.But I am not able to fix it out. Even my app getting die when I click on delete button. I am not getting any idea. My codes are as follows- Code:- package com.abc_fragment; import java.util.ArrayList; import com.abc.R; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android

Order of evaluation with relative layouts, best practices and parsing of relative-layout

旧时模样 提交于 2019-12-23 17:22:59
问题 I read this " It used to be that Android would use a single pass to process RelativeLayout-defined rules. That meant you could not reference a widget (e.g., via android:layout_above) until it had been declared in the XML. This made defining some layouts a bit complicated. Starting in Android 1.6, Android uses two passes to process the rules, so you can now safely have forward references to as-yet-undefined widgets. " I do not know what is the problem maybe is eclipse problem, but even I use 2

What is default color for text in textview?

…衆ロ難τιáo~ 提交于 2019-12-18 10:25:04
问题 I set the color to red , and after that I want to set the color again back to default, but I do not know what is default color, does anyone knows ? 回答1: You can save old color and then use it to restore the original value. Here is an example: ColorStateList oldColors = textView.getTextColors(); //save original colors textView.setTextColor(Color.RED); .... textView.setTextColor(oldColors);//restore original colors But in general default TextView text color is determined from current Theme

Android - keeping a single element contained on screen

时光怂恿深爱的人放手 提交于 2019-12-11 01:49:25
问题 I'm experimenting to see if the layout scheme I want to use is possible. I want to have an XML layout that's scrollable . Within that scrollable layout, I want to have a single line going horizontally across the screen (I used just a View with a fixed height and different color). When that horizontal line reaches the top of the screen, and as I scroll down through the layout, I want it to stop and remain at the top of the screen while being able to scroll through everything below it. I've

ViewPagerIndicator: TabPagerIndicator not visible

百般思念 提交于 2019-12-10 22:07:00
问题 im struggeling with the viewpagerindicator right now. When i use TitlePageIndicator, everything works fine. But when i try to use the TabPageIndicator I cant see it. It does not appear in the hierarchieview. I tried a lot of things like implement getTitle and getPagetitle, but it didnt work. When i set the layout_height to 100px i can see the bar, but there are no tabs. Really happy about any help. Thank you in advance. Here is my code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout

Android : Image button or button Highlighted with Effect when Pressed

懵懂的女人 提交于 2019-12-04 04:52:39
问题 Here when i pressed on these left and right arrow button at that time I want to see these type of effects on button. These same thing happens in Iphone/IOS by default. Can i make this type of effect? Here i mentioned the pic what exactly i want. Here i used this xml files but didnt got success. button_pressed.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"><shape> <gradient android:angle="180"

Disable home button in android

我的梦境 提交于 2019-12-02 18:51:49
问题 I add this code in my activity public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_HOME) { return false; } return super.onKeyDown(keyCode, event); } public void onAttachedToWindow() { super.onAttachedToWindow(); this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); } and the home button is looks like it is disabled But the problem is when someone press the menu button and when my menu button is shown and the user press home button then the

Android : Image button or button Highlighted with Effect when Pressed

♀尐吖头ヾ 提交于 2019-12-01 23:57:26
Here when i pressed on these left and right arrow button at that time I want to see these type of effects on button. These same thing happens in Iphone/IOS by default. Can i make this type of effect? Here i mentioned the pic what exactly i want. Here i used this xml files but didnt got success. button_pressed.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"><shape> <gradient android:angle="180" android:centerColor="#657377" android:endColor="#AFFFFFFF" android:startColor="#FFFFFFFF" android:type=

Android: draw arc within canvas api with a gradient fill color

。_饼干妹妹 提交于 2019-11-30 15:00:58
I want to draw an arc using canvas using a gradient fill. How can achieve this? Hey I stole this from here: Draw an arc with a SweepGradient in Android but it works fine, I used a LinearGradient instead. Shader gradient = new SweepGradient (0,getMeasuredHeight()/2, Color.RED, Color.WHITE); lightRed.setShader(gradient); canvas.drawArc(rectf, -90, 360, false, lightRed); In my cause i I had to draw someone like this: Maybe you too. So, let's think! How does Sweep Gradient works? If you draw rect via this: private val colors = intArrayOf(ContextCompat.getColor(context, R.color.progress_from_color)

What is default color for text in textview?

99封情书 提交于 2019-11-29 22:00:23
I set the color to red , and after that I want to set the color again back to default, but I do not know what is default color, does anyone knows ? You can save old color and then use it to restore the original value. Here is an example: ColorStateList oldColors = textView.getTextColors(); //save original colors textView.setTextColor(Color.RED); .... textView.setTextColor(oldColors);//restore original colors But in general default TextView text color is determined from current Theme applied to your Activity . Actually the color TextView is: android:textColor="@android:color/tab_indicator_text"