added empty image placeholder

This commit is contained in:
nuclearfog 2020-06-22 18:52:43 +02:00
parent c2ca8c6a76
commit 686c493f56
No known key found for this signature in database
GPG Key ID: ED35E22099354A64
9 changed files with 91 additions and 15 deletions

View File

@ -19,8 +19,9 @@
<option name="values">
<map>
<entry key="assetSourceType" value="FILE" />
<entry key="outputName" value="images" />
<entry key="sourceFile" value="$USER_HOME$/Dokumente/Rest/Entypo SVG/images.svg" />
<entry key="autoMirrored" value="true" />
<entry key="outputName" value="no_banner" />
<entry key="sourceFile" value="$USER_HOME$/Schreibtisch/no_banner.svg" />
</map>
</option>
</PersistentState>

View File

@ -404,7 +404,7 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
String pbLink = tweet.getUser().getImageLink();
if (!tweet.getUser().hasDefaultProfileImage())
pbLink += "_bigger";
Picasso.get().load(pbLink).into(profile_img);
Picasso.get().load(pbLink).error(R.drawable.no_image).into(profile_img);
}
String placeName = tweet.getLocationName();
if (placeName != null && !placeName.isEmpty()) {

View File

@ -82,7 +82,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
private TextView tweetTabTxt, favorTabTxt, txtUser, txtScrName;
private TextView txtLocation, txtCreated, lnkTxt, bioTxt, follow_back;
private Button following, follower;
private ImageView profile, banner;
private ImageView profileImage, bannerImage;
private View profile_head, profile_layer;
private ViewPager pager;
private TabLayout tabLayout;
@ -102,8 +102,8 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
following = findViewById(R.id.following);
follower = findViewById(R.id.follower);
lnkTxt = findViewById(R.id.links);
profile = findViewById(R.id.profile_img);
banner = findViewById(R.id.profile_banner);
profileImage = findViewById(R.id.profile_img);
bannerImage = findViewById(R.id.profile_banner);
txtUser = findViewById(R.id.profile_username);
txtScrName = findViewById(R.id.profile_screenname);
txtLocation = findViewById(R.id.location);
@ -150,8 +150,8 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
tabLayout.addOnTabSelectedListener(this);
following.setOnClickListener(this);
follower.setOnClickListener(this);
profile.setOnClickListener(this);
banner.setOnClickListener(this);
profileImage.setOnClickListener(this);
bannerImage.setOnClickListener(this);
lnkTxt.setOnClickListener(this);
}
@ -511,16 +511,16 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
if (user.hasBannerImg()) {
profile_layer.getLayoutParams().height = (int) getResources().getDimension(R.dimen.profile_banner_height);
String bannerLink = user.getBannerLink() + "/600x200";
Picasso.get().load(bannerLink).into(banner);
Picasso.get().load(bannerLink).error(R.drawable.no_banner).into(bannerImage);
} else {
banner.setImageResource(0);
bannerImage.setImageResource(0);
profile_layer.getLayoutParams().height = WRAP_CONTENT;
}
profile_layer.requestLayout();
String imgLink = user.getImageLink();
if (!user.hasDefaultProfileImage())
imgLink += "_bigger";
Picasso.get().load(imgLink).into(profile);
Picasso.get().load(imgLink).error(R.drawable.no_image).into(profileImage);
}
}

View File

@ -157,7 +157,7 @@ public class ListAdapter extends Adapter<ListAdapter.ListHolder> {
if (!owner.hasDefaultProfileImage()) {
pbLink += "_mini";
}
Picasso.get().load(pbLink).into(vh.pb_image);
Picasso.get().load(pbLink).error(R.drawable.no_image).into(vh.pb_image);
}
if (item.isFollowing()) {
vh.followList.setText(R.string.user_unfollow);

View File

@ -141,7 +141,7 @@ public class MessageAdapter extends Adapter<MessageAdapter.MessageHolder> {
if (!sender.hasDefaultProfileImage()) {
pbLink += "_mini";
}
Picasso.get().load(pbLink).into(vh.profile_img);
Picasso.get().load(pbLink).error(R.drawable.no_image).into(vh.profile_img);
}
}

View File

@ -226,7 +226,7 @@ public class TweetAdapter extends Adapter<ViewHolder> {
String pbLink = user.getImageLink();
if (!user.hasDefaultProfileImage())
pbLink += "_mini";
Picasso.get().load(pbLink).into(vh.profile);
Picasso.get().load(pbLink).error(R.drawable.no_image).into(vh.profile);
} else {
vh.profile.setImageResource(0);
}

View File

@ -144,7 +144,7 @@ public class UserAdapter extends Adapter<ViewHolder> {
if (!user.hasDefaultProfileImage()) {
pbLink += "_mini";
}
Picasso.get().load(pbLink).into(vh.profileImg);
Picasso.get().load(pbLink).error(R.drawable.no_image).into(vh.profileImg);
}
}
}

View File

@ -0,0 +1,38 @@
<vector android:autoMirrored="true"
android:height="40dp"
android:viewportHeight="4000"
android:viewportWidth="12000"
android:width="120dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<group>
<clip-path android:pathData="M0,0h12000v4000h-12000z" />
<path
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:pathData="M11533,5698C11521,5710 11501,5710 11489,5698L11419,5618 11348,5698C11336,5710 11316,5710 11304,5698 11291,5685 11291,5665 11304,5653L11376,5570 11304,5486C11291,5474 11291,5454 11304,5441 11316,5429 11336,5429 11348,5441L11419,5521 11489,5441C11501,5429 11521,5429 11533,5441 11546,5454 11546,5474 11533,5486L11461,5570 11533,5653C11546,5665 11546,5685 11533,5698L11533,5698Z"
android:strokeColor="#00000000"
android:strokeLineJoin="round"
android:strokeWidth="28.222" />
<path
android:fillColor="#000000"
android:fillType="evenOdd"
android:pathData="M6000,4000L0,4000 0,0 12000,0 12000,4000 6000,4000Z"
android:strokeColor="#00000000"
android:strokeLineJoin="round"
android:strokeWidth="28.222" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M6000,4000L0,4000 0,0 12000,0 12000,4000 6000,4000Z"
android:strokeColor="#3465A4"
android:strokeLineJoin="round"
android:strokeWidth="28.222" />
<path
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:pathData="M11262,1189C11236,1215 11194,1215 11168,1189L11023,1023 10877,1189C10851,1215 10809,1215 10783,1189 10758,1163 10758,1122 10783,1096L10935,923 10783,749C10758,723 10758,682 10783,656 10809,630 10851,630 10877,656L11023,823 11168,656C11194,630 11236,630 11262,656 11287,682 11287,723 11262,749L11110,923 11262,1096C11287,1122 11287,1163 11262,1189L11262,1189Z"
android:strokeColor="#00000000"
android:strokeLineJoin="round"
android:strokeWidth="28.222" />
</group>
</vector>

View File

@ -0,0 +1,37 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="4000"
android:viewportHeight="4000">
<group>
<clip-path android:pathData="M0,0h4000v4000h-4000z" />
<path
android:pathData="M11533,5698C11521,5710 11501,5710 11489,5698L11419,5618 11348,5698C11336,5710 11316,5710 11304,5698 11291,5685 11291,5665 11304,5653L11376,5570 11304,5486C11291,5474 11291,5454 11304,5441 11316,5429 11336,5429 11348,5441L11419,5521 11489,5441C11501,5429 11521,5429 11533,5441 11546,5454 11546,5474 11533,5486L11461,5570 11533,5653C11546,5665 11546,5685 11533,5698L11533,5698Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd" />
<path
android:pathData="M2000,4000L0,4000 0,0 4000,0 4000,4000 2000,4000Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="evenOdd" />
<path
android:pathData="M2000,4000L0,4000 0,0 4000,0 4000,4000 2000,4000Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#00000000"
android:strokeColor="#3465A4"
android:fillType="evenOdd" />
<path
android:pathData="M3417,1089C3391,1115 3349,1115 3323,1089L3178,923 3032,1089C3006,1115 2964,1115 2938,1089 2913,1063 2913,1022 2938,996L3090,823 2938,649C2913,623 2913,582 2938,556 2964,530 3006,530 3032,556L3178,723 3323,556C3349,530 3391,530 3417,556 3442,582 3442,623 3417,649L3265,823 3417,996C3442,1022 3442,1063 3417,1089L3417,1089Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd" />
</group>
</vector>