Revision 6e3fcb91
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/dialogs/RubikDialogTutorial.java | ||
---|---|---|
27 | 27 |
import android.util.TypedValue; |
28 | 28 |
import android.view.LayoutInflater; |
29 | 29 |
import android.view.View; |
30 |
import android.view.ViewGroup; |
|
30 | 31 |
import android.view.Window; |
31 | 32 |
import android.view.WindowManager; |
32 | 33 |
import android.widget.Button; |
... | ... | |
44 | 45 |
import org.distorted.main.R; |
45 | 46 |
import org.distorted.main.RubikActivity; |
46 | 47 |
import org.distorted.objects.RubikObjectList; |
47 |
import org.distorted.screens.RubikScreenPlay; |
|
48 |
import org.distorted.screens.ScreenList; |
|
49 | 48 |
import org.distorted.tutorials.TutorialList; |
50 | 49 |
|
51 | 50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
65 | 64 |
|
66 | 65 |
DisplayMetrics displaymetrics = new DisplayMetrics(); |
67 | 66 |
act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); |
68 |
final float titleSize= displaymetrics.widthPixels * RubikActivity.MENU_BIG_TEXT_SIZE; |
|
69 |
final float okSize = displaymetrics.widthPixels * RubikActivity.DIALOG_BUTTON_SIZE; |
|
67 |
int scrWidth = displaymetrics.widthPixels; |
|
68 |
final float titleSize= scrWidth*RubikActivity.MENU_BIG_TEXT_SIZE; |
|
69 |
final float okSize = scrWidth*RubikActivity.DIALOG_BUTTON_SIZE; |
|
70 |
final int tabHeight= (int)(scrWidth*RubikActivity.TAB_HEIGHT); |
|
71 |
final int tabWidth = (int)(scrWidth*RubikActivity.TAB_WIDTH); |
|
70 | 72 |
|
71 | 73 |
LayoutInflater layoutInflater = act.getLayoutInflater(); |
72 | 74 |
TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null); |
... | ... | |
93 | 95 |
tabLayout.setupWithViewPager(viewPager); |
94 | 96 |
viewPager.setCurrentItem(getTutorialOrdinal()); |
95 | 97 |
|
98 |
ViewGroup.LayoutParams paramsView = new ViewGroup.LayoutParams( tabWidth,tabHeight ); |
|
99 |
|
|
96 | 100 |
for(int i=0; i<TutorialList.NUM_OBJECTS; i++) |
97 | 101 |
{ |
98 | 102 |
TutorialList list = TutorialList.getObject(i); |
99 | 103 |
int iconID = list.getIconID(); |
100 | 104 |
ImageView imageView = new ImageView(act); |
105 |
imageView.setLayoutParams(paramsView); |
|
101 | 106 |
imageView.setImageResource(iconID); |
102 | 107 |
TabLayout.Tab tab = tabLayout.getTabAt(i); |
103 | 108 |
if(tab!=null) tab.setCustomView(imageView); |
Also available in: Unified diff
Remove 3 out of 4 object icons.