I want to design the layout of this type of app(as shown in the image). In this layout when we click the circle icon it moves to next page. I want to know how its done.
Asked
Active
Viewed 3.8k times
5

Shahzad Barkati
- 2,532
- 6
- 25
- 33

Prabhjot Singh Chadha
- 53
- 1
- 1
- 6
-
http://i.stack.imgur.com/2xLu1.jpg – Prabhjot Singh Chadha Oct 31 '15 at 10:44
-
1http://stackoverflow.com/questions/21178193/android-draw-circle-with-text-inside – Chaudhary Amar Oct 31 '15 at 11:14
3 Answers
5
in drawer folder create circle_background.xml and put this code to it :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<solid android:color="#FE4543"></solid>
<stroke android:color="#FE4543" android:width="1dp"></stroke>
</shape>
so now in your activity add image view like this
<ImageView
android:layout_width="wrap_content"
android:gravity="center"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_search"
android:padding="15dp"
android:id="@+id/btn_search"
android:background="@drawable/circle_background"
/>
and if you want to add click action on this you have to use intent something like this , my view id is btn_search so at the first i have to find it like this and then set onclick listener for it like below
ImageView btnSearch= (ImageView) findViewById(R.id.btn_search);
btnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(getApplicationContext(),ExampleActivity.class)
}
});

dev.doc
- 569
- 3
- 12
- 18

Saeed Darvish
- 621
- 6
- 29
0
The top one I think it can implement by ImageButton
simplely.
Another one need a Layout
with a circle background, and contain ImageView
and TextView
.
Hope it will be help for you.

chace
- 1
- 2
-1
public class TourActivity extends AppCompatActivity {
private ImageView tour;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tour);
tour = (ImageView) findViewById(R.id.tour);
tour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(getApplicationContext(),FirstActivity.class);
launchThird();
}
});
}
private void launchThird() {
Intent intent = new Intent(this, FirstActivity.class);
startActivity(intent);
}
}
-
You will need to provide more to your answer than just code. Consider explaining what was wrong, or how you are fixing the original problem – Fabulous Apr 07 '18 at 14:01