Revision 6e3fcb91
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/dialogs/RubikDialogPattern.java | ||
---|---|---|
33 | 33 |
import android.util.TypedValue; |
34 | 34 |
import android.view.LayoutInflater; |
35 | 35 |
import android.view.View; |
36 |
import android.view.ViewGroup; |
|
36 | 37 |
import android.view.Window; |
37 | 38 |
import android.view.WindowManager; |
38 | 39 |
import android.widget.Button; |
... | ... | |
64 | 65 |
|
65 | 66 |
DisplayMetrics displaymetrics = new DisplayMetrics(); |
66 | 67 |
act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); |
67 |
final float titleSize= displaymetrics.widthPixels * RubikActivity.MENU_BIG_TEXT_SIZE; |
|
68 |
final float okSize = displaymetrics.widthPixels * RubikActivity.DIALOG_BUTTON_SIZE; |
|
68 |
|
|
69 |
int scrWidth = displaymetrics.widthPixels; |
|
70 |
final float titleSize= scrWidth*RubikActivity.MENU_BIG_TEXT_SIZE; |
|
71 |
final float okSize = scrWidth*RubikActivity.DIALOG_BUTTON_SIZE; |
|
72 |
final int tabHeight= (int)(scrWidth*RubikActivity.TAB_HEIGHT); |
|
73 |
final int tabWidth = (int)(scrWidth*RubikActivity.TAB_WIDTH); |
|
69 | 74 |
|
70 | 75 |
LayoutInflater layoutInflater = act.getLayoutInflater(); |
71 | 76 |
TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null); |
... | ... | |
92 | 97 |
tabLayout.setupWithViewPager(viewPager); |
93 | 98 |
viewPager.setCurrentItem(getPatternOrdinal()); |
94 | 99 |
|
100 |
ViewGroup.LayoutParams paramsView = new ViewGroup.LayoutParams( tabWidth,tabHeight ); |
|
101 |
|
|
95 | 102 |
for(int i=0; i< RubikPatternList.NUM_OBJECTS; i++) |
96 | 103 |
{ |
97 |
int ordinal = RubikPatternList.getObject(i);
|
|
104 |
int ordinal = RubikPatternList.getObject(i); |
|
98 | 105 |
RubikObject object = RubikObjectList.getObject(ordinal); |
99 |
int iconSize= RubikActivity.getDrawableSize(); |
|
100 |
int iconID = object==null ? 0 : object.getIconID(iconSize); |
|
106 |
int iconID = object==null ? 0 : object.getIconID(); |
|
101 | 107 |
|
102 | 108 |
ImageView imageView = new ImageView(act); |
103 | 109 |
imageView.setImageResource(iconID); |
110 |
imageView.setLayoutParams(paramsView); |
|
104 | 111 |
TabLayout.Tab tab = tabLayout.getTabAt(i); |
105 | 112 |
if(tab!=null) tab.setCustomView(imageView); |
106 | 113 |
} |
Also available in: Unified diff
Remove 3 out of 4 object icons.