Project

General

Profile

« Previous | Next » 

Revision da77ffd8

Added by Leszek Koltunski over 5 years ago

Dynamic App: add Toast.

View differences:

src/main/java/org/distorted/examples/dynamic/DynamicActivity.java
27 27
import android.app.Activity;
28 28
import android.opengl.GLSurfaceView;
29 29
import android.os.Bundle;
30
import android.view.Gravity;
30 31
import android.view.View;
31 32
import android.widget.AdapterView;
32 33
import android.widget.ArrayAdapter;
......
34 35
import android.widget.Spinner;
35 36
import android.widget.TextView;
36 37
import android.widget.SeekBar.OnSeekBarChangeListener;
38
import android.widget.Toast;
37 39

  
38 40
///////////////////////////////////////////////////////////////////////////////////////////////////
39 41

  
......
93 95
        bar0.setProgress(0);
94 96
        bar1.setProgress(0);
95 97
        bar2.setProgress(0);
98

  
99
        Toast toast = Toast.makeText(this, R.string.example_dynamic_toast, Toast.LENGTH_LONG);
100
        toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
101
        toast.show();
96 102
        }
97 103
      }
98 104

  
src/main/res/layout/dynamicslayout.xml
106 106
            android:orientation="horizontal"
107 107
            android:layout_width="match_parent"
108 108
            android:layout_height="match_parent"
109
            android:layout_weight="15">
109
            android:layout_weight="15"
110
            android:paddingBottom="5dp">
110 111

  
111 112
            <SeekBar
112 113
                android:id="@+id/dynamicSeekNoise0"
......
144 145
    <LinearLayout
145 146
        android:orientation="horizontal"
146 147
        android:layout_width="match_parent"
147
        android:layout_height="48dp">
148
        android:layout_height="48dp"
149
        android:paddingTop="5dp">
148 150

  
149 151
        <Button
150 152
            android:id="@+id/dynamicButtonStart"
src/main/res/values/strings.xml
195 195
    <string name="example_movingeffects_toast">Click on \'RESET\' and define your path by touching the screen. Then click on one of the effects and see it move along your path.</string>
196 196
    <string name="example_rotate_toast">Rotate the scene by swiping the screen</string>
197 197
    <string name="example_effects2d_toast">Failed to add new effect</string>
198
    <string name="example_dynamic_toast">First configure the Dynamic (above).\n\nThen touch the screen to add several points which will define the path to interpolate through.\n\nFinally click \'Start\'.</string>
198 199
</resources>

Also available in: Unified diff