Android overlapping profile photos view
I am trying to implement this view.
I tried it this way.
<LinearLayout
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="10dp">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image1"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
app:civ_border_width="1dp"
app:civ_border_color="@color/white_two"
app:civ_shadow="false"/>
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image2"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
android:layout_marginStart="-10dp"
app:civ_border_width="1dp"
app:civ_border_color="@color/white"
app:civ_shadow="false"/>
</LinearLayout>
But the second picture stays above the first and I want it the other way around. I would add the images programmatically so I don't think I could use RelativeLayout. Is this possible or is there an existing Android library for this already?
android android-linearlayout android-imageview
add a comment |
I am trying to implement this view.
I tried it this way.
<LinearLayout
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="10dp">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image1"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
app:civ_border_width="1dp"
app:civ_border_color="@color/white_two"
app:civ_shadow="false"/>
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image2"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
android:layout_marginStart="-10dp"
app:civ_border_width="1dp"
app:civ_border_color="@color/white"
app:civ_shadow="false"/>
</LinearLayout>
But the second picture stays above the first and I want it the other way around. I would add the images programmatically so I don't think I could use RelativeLayout. Is this possible or is there an existing Android library for this already?
android android-linearlayout android-imageview
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
1
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39
add a comment |
I am trying to implement this view.
I tried it this way.
<LinearLayout
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="10dp">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image1"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
app:civ_border_width="1dp"
app:civ_border_color="@color/white_two"
app:civ_shadow="false"/>
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image2"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
android:layout_marginStart="-10dp"
app:civ_border_width="1dp"
app:civ_border_color="@color/white"
app:civ_shadow="false"/>
</LinearLayout>
But the second picture stays above the first and I want it the other way around. I would add the images programmatically so I don't think I could use RelativeLayout. Is this possible or is there an existing Android library for this already?
android android-linearlayout android-imageview
I am trying to implement this view.
I tried it this way.
<LinearLayout
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="10dp">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image1"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
app:civ_border_width="1dp"
app:civ_border_color="@color/white_two"
app:civ_shadow="false"/>
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image2"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/profile_default"
android:layout_marginStart="-10dp"
app:civ_border_width="1dp"
app:civ_border_color="@color/white"
app:civ_shadow="false"/>
</LinearLayout>
But the second picture stays above the first and I want it the other way around. I would add the images programmatically so I don't think I could use RelativeLayout. Is this possible or is there an existing Android library for this already?
android android-linearlayout android-imageview
android android-linearlayout android-imageview
edited Nov 22 '18 at 9:24
Rio Marie A. Callos
asked Nov 22 '18 at 9:16
Rio Marie A. CallosRio Marie A. Callos
74114
74114
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
1
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39
add a comment |
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
1
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
1
1
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39
add a comment |
2 Answers
2
active
oldest
votes
you can try using android:elevation="8dp"
in your first code to made your first over the second view
add a comment |
This is what I did to generate the images programmatically.
val circleImageView1 = CircleImageView(context)
circleImageView1.layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
circleImageView1.borderWidth = 1
circleImageView1.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView1.circleBackgroundColor = ContextCompat.getColor(context, R.color.blue)
circleImageView1.setImageResource(R.drawable.profile_default)
val layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
layoutParams.setMargins(Tools.dpToPx(-10), 0, 0, 0)
val circleImageView2 = CircleImageView(context)
circleImageView2.layoutParams = layoutParams
circleImageView2.borderWidth = 1
circleImageView2.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView2.circleBackgroundColor = ContextCompat.getColor(context, R.color.red)
circleImageView2.setImageResource(R.drawable.profile_default)
val circleImageView3 = CircleImageView(context)
circleImageView3.layoutParams = layoutParams
circleImageView3.borderWidth = 1
circleImageView3.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView3.circleBackgroundColor = ContextCompat.getColor(context, R.color.green)
circleImageView3.setImageResource(R.drawable.profile_default)
itemView.images.addView(circleImageView1)
itemView.images.addView(circleImageView2)
itemView.images.addView(circleImageView3)
itemView.images.scaleX = -1.0f
This works for now I just need to make sure to go through the list of images reversely since order is important.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427440%2fandroid-overlapping-profile-photos-view%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
you can try using android:elevation="8dp"
in your first code to made your first over the second view
add a comment |
you can try using android:elevation="8dp"
in your first code to made your first over the second view
add a comment |
you can try using android:elevation="8dp"
in your first code to made your first over the second view
you can try using android:elevation="8dp"
in your first code to made your first over the second view
answered Nov 22 '18 at 9:51
JEFFJEFF
144
144
add a comment |
add a comment |
This is what I did to generate the images programmatically.
val circleImageView1 = CircleImageView(context)
circleImageView1.layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
circleImageView1.borderWidth = 1
circleImageView1.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView1.circleBackgroundColor = ContextCompat.getColor(context, R.color.blue)
circleImageView1.setImageResource(R.drawable.profile_default)
val layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
layoutParams.setMargins(Tools.dpToPx(-10), 0, 0, 0)
val circleImageView2 = CircleImageView(context)
circleImageView2.layoutParams = layoutParams
circleImageView2.borderWidth = 1
circleImageView2.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView2.circleBackgroundColor = ContextCompat.getColor(context, R.color.red)
circleImageView2.setImageResource(R.drawable.profile_default)
val circleImageView3 = CircleImageView(context)
circleImageView3.layoutParams = layoutParams
circleImageView3.borderWidth = 1
circleImageView3.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView3.circleBackgroundColor = ContextCompat.getColor(context, R.color.green)
circleImageView3.setImageResource(R.drawable.profile_default)
itemView.images.addView(circleImageView1)
itemView.images.addView(circleImageView2)
itemView.images.addView(circleImageView3)
itemView.images.scaleX = -1.0f
This works for now I just need to make sure to go through the list of images reversely since order is important.
add a comment |
This is what I did to generate the images programmatically.
val circleImageView1 = CircleImageView(context)
circleImageView1.layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
circleImageView1.borderWidth = 1
circleImageView1.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView1.circleBackgroundColor = ContextCompat.getColor(context, R.color.blue)
circleImageView1.setImageResource(R.drawable.profile_default)
val layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
layoutParams.setMargins(Tools.dpToPx(-10), 0, 0, 0)
val circleImageView2 = CircleImageView(context)
circleImageView2.layoutParams = layoutParams
circleImageView2.borderWidth = 1
circleImageView2.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView2.circleBackgroundColor = ContextCompat.getColor(context, R.color.red)
circleImageView2.setImageResource(R.drawable.profile_default)
val circleImageView3 = CircleImageView(context)
circleImageView3.layoutParams = layoutParams
circleImageView3.borderWidth = 1
circleImageView3.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView3.circleBackgroundColor = ContextCompat.getColor(context, R.color.green)
circleImageView3.setImageResource(R.drawable.profile_default)
itemView.images.addView(circleImageView1)
itemView.images.addView(circleImageView2)
itemView.images.addView(circleImageView3)
itemView.images.scaleX = -1.0f
This works for now I just need to make sure to go through the list of images reversely since order is important.
add a comment |
This is what I did to generate the images programmatically.
val circleImageView1 = CircleImageView(context)
circleImageView1.layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
circleImageView1.borderWidth = 1
circleImageView1.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView1.circleBackgroundColor = ContextCompat.getColor(context, R.color.blue)
circleImageView1.setImageResource(R.drawable.profile_default)
val layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
layoutParams.setMargins(Tools.dpToPx(-10), 0, 0, 0)
val circleImageView2 = CircleImageView(context)
circleImageView2.layoutParams = layoutParams
circleImageView2.borderWidth = 1
circleImageView2.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView2.circleBackgroundColor = ContextCompat.getColor(context, R.color.red)
circleImageView2.setImageResource(R.drawable.profile_default)
val circleImageView3 = CircleImageView(context)
circleImageView3.layoutParams = layoutParams
circleImageView3.borderWidth = 1
circleImageView3.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView3.circleBackgroundColor = ContextCompat.getColor(context, R.color.green)
circleImageView3.setImageResource(R.drawable.profile_default)
itemView.images.addView(circleImageView1)
itemView.images.addView(circleImageView2)
itemView.images.addView(circleImageView3)
itemView.images.scaleX = -1.0f
This works for now I just need to make sure to go through the list of images reversely since order is important.
This is what I did to generate the images programmatically.
val circleImageView1 = CircleImageView(context)
circleImageView1.layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
circleImageView1.borderWidth = 1
circleImageView1.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView1.circleBackgroundColor = ContextCompat.getColor(context, R.color.blue)
circleImageView1.setImageResource(R.drawable.profile_default)
val layoutParams = LinearLayout.LayoutParams(Tools.dpToPx(40), Tools.dpToPx(40))
layoutParams.setMargins(Tools.dpToPx(-10), 0, 0, 0)
val circleImageView2 = CircleImageView(context)
circleImageView2.layoutParams = layoutParams
circleImageView2.borderWidth = 1
circleImageView2.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView2.circleBackgroundColor = ContextCompat.getColor(context, R.color.red)
circleImageView2.setImageResource(R.drawable.profile_default)
val circleImageView3 = CircleImageView(context)
circleImageView3.layoutParams = layoutParams
circleImageView3.borderWidth = 1
circleImageView3.borderColor = ContextCompat.getColor(context, R.color.white_two)
circleImageView3.circleBackgroundColor = ContextCompat.getColor(context, R.color.green)
circleImageView3.setImageResource(R.drawable.profile_default)
itemView.images.addView(circleImageView1)
itemView.images.addView(circleImageView2)
itemView.images.addView(circleImageView3)
itemView.images.scaleX = -1.0f
This works for now I just need to make sure to go through the list of images reversely since order is important.
answered Nov 22 '18 at 10:13
Rio Marie A. CallosRio Marie A. Callos
74114
74114
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427440%2fandroid-overlapping-profile-photos-view%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried with FrameLayout?
– Salman Khan
Nov 22 '18 at 9:21
put your code to add ImageView .
– Chetan Joshi
Nov 22 '18 at 9:27
user RelativeLayout and marginStart or end -2dp
– Shahriyar Aghajani
Nov 22 '18 at 9:41
1
hopefully this helps you github.com/KartikPrajapati/StackImageView
– Zahoor Saleem
Nov 25 '18 at 16:10
@ZahoorSaleem this is exactly what i was looking for
– Rio Marie A. Callos
Nov 26 '18 at 4:39