1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2024-12-23 07:38:04 +01:00

リアクションボタンのサイズ調整

This commit is contained in:
tateisu 2018-08-23 09:32:55 +09:00
parent 72482a1674
commit 3a2dc2e811
100 changed files with 45 additions and 28 deletions

View File

@ -485,7 +485,7 @@ internal class ItemViewHolder(
n.time_created_at,
R.attr.ic_question,
R.string.display_name_reaction_by
, reaction?.drawableId
, reaction?.btnDrawableId
)
if(n_status != null) showStatus(activity, n_status)
@ -1471,10 +1471,9 @@ internal class ItemViewHolder(
val buttonHeight = ActMain.boostButtonSize
val marginBetween = (ActMain.boostButtonSize.toFloat() * 0.05f + 0.5f).toInt()
val paddingH = (buttonHeight.toFloat() / 10 + 0.5f).toInt()
val paddingV = (buttonHeight.toFloat() / 10 + 0.5f).toInt()
val compoundPaddingDp =
ActMain.boostButtonSize.toFloat() * 0.00f / activity.resources.displayMetrics.density
val paddingH = (buttonHeight.toFloat() *0.1f + 0.5f).toInt()
val paddingV = (buttonHeight.toFloat() *0.1f + 0.5f).toInt()
val compoundPaddingDp = 0f // ActMain.boostButtonSize.toFloat() * 0f / activity.resources.displayMetrics.density
val box = FlexboxLayout(activity)
val boxLp = LinearLayout.LayoutParams(
@ -1517,7 +1516,7 @@ internal class ItemViewHolder(
)
b.minimumWidth = buttonHeight
b.imageResource = mr.drawableId
b.imageResource = mr.btnDrawableId
b.scaleType = ImageView.ScaleType.FIT_CENTER
b.layoutParams = blp

View File

@ -369,9 +369,9 @@ class StatusButtonsViewHolder(
private val buttonHeight = ActMain.boostButtonSize
private val marginBetween = (ActMain.boostButtonSize.toFloat() * 0.05f + 0.5f).toInt()
val paddingH = (buttonHeight.toFloat()/10 +0.5f).toInt()
val paddingV = (buttonHeight.toFloat()/10 +0.5f).toInt()
val compoundPaddingDp = ActMain.boostButtonSize.toFloat() * -0.085f / activity.resources.displayMetrics.density
val paddingH = (buttonHeight.toFloat()*0.1f +0.5f).toInt()
val paddingV = (buttonHeight.toFloat()*0.1f +0.5f).toInt()
val compoundPaddingDp = 0f // ActMain.boostButtonSize.toFloat() * -0f / activity.resources.displayMetrics.density
val viewRoot : FlexboxLayout

View File

@ -2,25 +2,30 @@ package jp.juggler.subwaytooter.api.entity
import jp.juggler.subwaytooter.R
enum class MisskeyReaction(val shortcode:String,val drawableId:Int){
Like("like", R.drawable.emj_1f44d),
Love("love",R.drawable.emj_2665),
Laugh("laugh",R.drawable.emj_1f606),
Hmm("hmm", R.drawable.emj_1f914),
Surprise("surprise",R.drawable.emj_1f62e),
Congrats("congrats",R.drawable.emj_1f389),
Angry("angry",R.drawable.emj_1f4a2),
Confused("confused",R.drawable.emj_1f625),
Rip("rip", R.drawable.emj_1f607),
Pudding("pudding", R.drawable.emj_1f36e) ;
enum class MisskeyReaction(
val shortcode : String,
val drawableId : Int,
val btnDrawableId : Int
) {
Like("like", R.drawable.emj_1f44d, R.drawable.btn_reaction_angry),
Love("love", R.drawable.emj_2665, R.drawable.btn_reaction_confused),
Laugh("laugh", R.drawable.emj_1f606, R.drawable.btn_reaction_congrats),
Hmm("hmm", R.drawable.emj_1f914, R.drawable.btn_reaction_hmm),
Surprise("surprise", R.drawable.emj_1f62e, R.drawable.btn_reaction_laugh),
Congrats("congrats", R.drawable.emj_1f389, R.drawable.btn_reaction_like),
Angry("angry", R.drawable.emj_1f4a2, R.drawable.btn_reaction_love),
Confused("confused", R.drawable.emj_1f625, R.drawable.btn_reaction_pudding),
Rip("rip", R.drawable.emj_1f607, R.drawable.btn_reaction_rip),
Pudding("pudding", R.drawable.emj_1f36e, R.drawable.btn_reaction_surprise)
;
companion object {
val shortcodeMap: HashMap<String,MisskeyReaction> by lazy {
HashMap<String,MisskeyReaction>().apply {
for( e in MisskeyReaction.values()){
put( e.shortcode,e)
val shortcodeMap : HashMap<String, MisskeyReaction> by lazy {
HashMap<String, MisskeyReaction>().apply {
for(e in MisskeyReaction.values()) {
put(e.shortcode, e)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -124,4 +124,17 @@ my $res_dir = "app/src/main/res";
#resize_scales( "_ArtWork/ic_cat.png" ,$res_dir,"drawable","ic_cat",0,24);
#resize_scales( "_ArtWork/ic_shield.png" ,$res_dir,"drawable","ic_shield",0,24);
resize_scales( "_ArtWork/ic_mobile.png" ,$res_dir,"drawable","ic_mobile",0,24);
#resize_scales( "_ArtWork/ic_mobile.png" ,$res_dir,"drawable","ic_mobile",0,24);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_angry.png" ,$res_dir,"drawable","btn_reaction_angry",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_confused.png" ,$res_dir,"drawable","btn_reaction_confused",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_congrats.png" ,$res_dir,"drawable","btn_reaction_congrats",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_hmm.png" ,$res_dir,"drawable","btn_reaction_hmm",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_laugh.png" ,$res_dir,"drawable","btn_reaction_laugh",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_like.png" ,$res_dir,"drawable","btn_reaction_like",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_love.png" ,$res_dir,"drawable","btn_reaction_love",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_pudding.png" ,$res_dir,"drawable","btn_reaction_pudding",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_rip.png" ,$res_dir,"drawable","btn_reaction_rip",0,32);
resize_scales( "_ArtWork/misskey-reaction/btn_reaction_surprise.png" ,$res_dir,"drawable","btn_reaction_surprise",0,32);