Skip to content

Commit ffb3397

Browse files
author
mobyiapps
committed
Update
1 parent 6728651 commit ffb3397

File tree

13 files changed

+598
-4
lines changed

13 files changed

+598
-4
lines changed

app/src/main/java/com/dvinfosys/WidgetsExample/MainActivity.java

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,70 @@
11
package com.dvinfosys.WidgetsExample;
22

3+
import android.content.Context;
34
import android.net.Uri;
45
import android.os.Bundle;
56
import android.support.v7.app.AppCompatActivity;
7+
import android.view.View;
8+
import android.widget.Button;
69

10+
import com.dvinfosys.widgets.ToastView.ToastView;
711
import com.dvinfosys.widgets.VideoPlayer.VPVideoPlayer;
812
import com.dvinfosys.widgets.VideoPlayer.VPVideoPlayerStandard;
913

1014
public class MainActivity extends AppCompatActivity {
1115

16+
private Context context;
17+
private Button btnErrorToastView, btnSuccessToastView, btnInfoToastView, btnWarringToastView;
18+
1219
@Override
1320
protected void onCreate(Bundle savedInstanceState) {
1421
super.onCreate(savedInstanceState);
1522
setContentView(R.layout.activity_main);
23+
context=this;
24+
btnErrorToastView = findViewById(R.id.button_error_toast);
25+
btnSuccessToastView = findViewById(R.id.button_success_toast);
26+
btnInfoToastView = findViewById(R.id.button_info_toast);
27+
btnWarringToastView = findViewById(R.id.button_warning_toast);
1628

1729
VPVideoPlayerStandard videoPlayerStandard = findViewById(R.id.vp_videoplayer);
18-
videoPlayerStandard.setUp("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",VPVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,"Elephant Dream");
30+
videoPlayerStandard.setUp("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", VPVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "Elephant Dream");
1931
videoPlayerStandard.thumbImageView.setImageURI(Uri.parse("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg"));
32+
33+
btnErrorToastView.setOnClickListener(new View.OnClickListener() {
34+
@Override
35+
public void onClick(View v) {
36+
ToastView.error(context,"This is error ToastView",ToastView.LENGTH_SHORT).show();
37+
}
38+
});
39+
btnWarringToastView.setOnClickListener(new View.OnClickListener() {
40+
@Override
41+
public void onClick(View v) {
42+
ToastView.warning(context,"This is warring ToastView",ToastView.LENGTH_SHORT).show();
43+
}
44+
});
45+
btnInfoToastView.setOnClickListener(new View.OnClickListener() {
46+
@Override
47+
public void onClick(View v) {
48+
ToastView.info(context,"This is info ToastView",ToastView.LENGTH_SHORT).show();
49+
}
50+
});
51+
52+
btnSuccessToastView.setOnClickListener(new View.OnClickListener() {
53+
@Override
54+
public void onClick(View v) {
55+
ToastView.success(context,"This is success ToastView",ToastView.LENGTH_SHORT).show();
56+
}
57+
});
2058
}
2159

2260
@Override
2361
public void onBackPressed() {
24-
if (VPVideoPlayer.backPress()){
62+
if (VPVideoPlayer.backPress()) {
2563
return;
2664
}
2765
super.onBackPressed();
2866
}
67+
2968
@Override
3069
protected void onPause() {
3170
super.onPause();

app/src/main/res/layout/activity_main.xml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,76 @@
116116
app:button_font="Smoothy.otf" />
117117

118118
<com.dvinfosys.widgets.VideoPlayer.VPVideoPlayerStandard
119-
android:layout_width="match_parent"
120119
android:id="@+id/vp_videoplayer"
121-
android:layout_height="200dp"/>
120+
android:layout_width="match_parent"
121+
android:layout_height="250dp" />
122+
123+
<LinearLayout
124+
android:layout_width="match_parent"
125+
android:layout_height="wrap_content"
126+
android:orientation="vertical"
127+
android:paddingLeft="16dp"
128+
android:paddingTop="16dp"
129+
android:paddingRight="16dp"
130+
android:paddingBottom="16dp">
131+
132+
<Button
133+
android:id="@+id/button_error_toast"
134+
android:layout_width="wrap_content"
135+
android:layout_height="wrap_content"
136+
android:text="Error ToastView"
137+
android:textAllCaps="false" />
138+
139+
<Button
140+
android:id="@+id/button_success_toast"
141+
android:layout_width="wrap_content"
142+
android:layout_height="wrap_content"
143+
android:text="Success ToastView"
144+
android:textAllCaps="false" />
145+
146+
<Button
147+
android:id="@+id/button_info_toast"
148+
android:layout_width="wrap_content"
149+
android:layout_height="wrap_content"
150+
android:text="Info ToastView"
151+
android:textAllCaps="false" />
152+
153+
<Button
154+
android:id="@+id/button_info_toast_with_formatting"
155+
android:layout_width="wrap_content"
156+
android:layout_height="wrap_content"
157+
android:text="Info ToastView (With Formatting)"
158+
android:textAllCaps="false" />
159+
160+
<Button
161+
android:id="@+id/button_warning_toast"
162+
android:layout_width="wrap_content"
163+
android:layout_height="wrap_content"
164+
android:text="Warning ToastView"
165+
android:textAllCaps="false" />
166+
167+
<Button
168+
android:id="@+id/button_normal_toast_wo_icon"
169+
android:layout_width="wrap_content"
170+
android:layout_height="wrap_content"
171+
android:text="Normal ToastView (without icon)"
172+
android:textAllCaps="false" />
173+
174+
<Button
175+
android:id="@+id/button_normal_toast_w_icon"
176+
android:layout_width="wrap_content"
177+
android:layout_height="wrap_content"
178+
android:text="Normal ToastView With Icon"
179+
android:textAllCaps="false" />
180+
181+
<Button
182+
android:id="@+id/button_custom_config"
183+
android:layout_width="wrap_content"
184+
android:layout_height="wrap_content"
185+
android:text="Custom Configuration"
186+
android:textAllCaps="false" />
187+
188+
</LinearLayout>
122189

123190
</LinearLayout>
124191
</ScrollView>

0 commit comments

Comments
 (0)