New to android and need an explanation about #+id/edit_message [closed] - android

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
<EditText android:id="#+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="#string/edit_message" />
what is the purpose of #+id/edit_message? I am searching for it yet I haven't found a clear explanations.

This means you are creating a reference for the EditText so that it can be used in another View, layout file, or in your Java code.
To me, it is very much like declaring a variable in your code.
String ggjon = "New to android and need an explanation";
The difference between using #+id/edit_message and #id/edit_message is declaration vs. referencing an already declared View.

You define id for your TextEdit. Thanks to that You can access it via Java code:
EditText myedit = (EditText)this.findViewById(R.id.edit_message);

Related

How to make this bar in android studio [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
i don't know how to make this bar in the layout in android studio?
i want the XML code for this part of the activity.
You can use Seekbar to achieve a similar one. Please refer this for more information: https://developer.android.com/reference/android/widget/SeekBar.html
This is a sample xml:
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="26dp"
android:max="100" >
</SeekBar>
Feel free to customize the indicators. Also, this is a good tutorial: http://abhiandroid.com/ui/seekbar

How to make a vertical range seekbar? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a application which needs a vertical range seekbar which has two thumbs for adjusting the position.I have no idea how to make a one. Please help me out..
Similar to this seekbar.
ok I found this library:
https://github.com/edmodo/range-bar
<com.edmodo.rangebar.RangeBar
android:id="#+id/rb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:rotation="90"
app:tickCount="16"
/>
int left_index = rb.getLeftIndex();
int right_index = rb.getRightIndex();
hope it will be usefull

How to create an arc shaped progress bar in Android? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to create a progress bar like the following image.
My requirements are:
1. I want to be able to set a progress value to it programmatically.
2. I want to be able to change the colors of the arc - both the background one (grey) and the foreground one (green).
I looked into libraries but found none that do it in this particular shape and style. I am not proficient enough in creating custom drawables to be able to create this by myself. Any help is appreciated!
In addition to the above answer, you can also use CircleProgress which seems to have something that looks exactly like your use case:
Usage:
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="#+id/arc_progress"
android:background="#214193"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:arc_progress="55"
custom:arc_bottom_text="MEMORY"/>
Also, if you check the license on this library (bottom of their README), it seems like it's very favorable to using it however you wish.
You can use SeekArc. It can do everything you need to get that result.
It would look something like this
<com.triggertrap.seekarc.SeekArc
android:id="#+id/seekArc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:rotation="180"
seekarc:startAngle="30"
seekarc:sweepAngle="300"
seekarc:arcColor="#color/grey"
seekarc:progressColor="#color/green"
seekarc:touchInside="true" />

unable to change custom progressbar width in android [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
ProgressBar progressBar=new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal);
progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progress_bar));
progressBar.setMinimumWidth(100);
Try to change it from Resources, from XML.
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
EDIT :
If you want to change it on runtime, take a look on this link.

What kind of android widget should I use for making multiple choice answers for questions? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am creating an android application and would like to set up my activity to have a question with multiple answers that they could chose from. I was thinking radio buttons but I'm sure there is something more appropriate for this task. Example
Question
Answer1[x] Answer2[x] Answer3[x]
Use TextView for the question and ListView with multiple choices for the answers below
ListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
Use CheckBox if the user can select multiple options.
RadioButtonis for when the user can only select one option.
As for layout:
It really depends, there are a lot of possible solutions, one possibility is:
<!--not all attributes are included,such as width and height, you have to add them-->
<LinearLayout android:orientation="vertical">
<TextView />
<LinearLayout android:orientation="horizontal"> <!--contains options-->
<CheckBox /> <CheckBox/> <CheckBox />
</LinearLayout>
</LinearLayout>

Categories

Resources