Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank02051997 committed Oct 27, 2017
1 parent cd86d57 commit 7b34c4a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.shashank.sony.fancytoastlib.FancyToast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
Button b1,b2,b3,b4,b5,b6;
Button b1,b2,b3,b4,b5,b6,b7,b8;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -20,12 +20,16 @@ protected void onCreate(Bundle savedInstanceState) {
b4=(Button) findViewById(R.id.button4);
b5=(Button) findViewById(R.id.button5);
b6=(Button) findViewById(R.id.button6);
b7=(Button) findViewById(R.id.button7);
b8=(Button) findViewById(R.id.button8);
b1.setOnClickListener(this);
b2.setOnClickListener(this);
b3.setOnClickListener(this);
b4.setOnClickListener(this);
b5.setOnClickListener(this);
b6.setOnClickListener(this);
b7.setOnClickListener(this);
b8.setOnClickListener(this);
}
@Override
public void onClick(View v)
Expand All @@ -41,5 +45,8 @@ else if(v.getId()==R.id.button5)
FancyToast.makeText(this,"Here is some Info for you",FancyToast.LENGTH_LONG,FancyToast.INFO,true).show();
else if(v.getId()==R.id.button6)
FancyToast.makeText(this,"This is Confusing Toast",FancyToast.LENGTH_LONG,FancyToast.CONFUSING,false).show();
}
else if(v.getId()==R.id.button7)
FancyToast.makeText(this,"This is Custom Toast",FancyToast.LENGTH_LONG,FancyToast.CONFUSING,R.drawable.ic_android_black_24dp).show();
else if(v.getId()==R.id.button8)
FancyToast.makeText(this,"This is a Success Toast",FancyToast.LENGTH_LONG,FancyToast.SUCCESS,false).show(); }
}
17 changes: 17 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,21 @@
android:layout_alignBottom="@+id/button5"
android:layout_alignParentEnd="true"
android:text="Confusing" />

<Button
android:id="@+id/button7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/button"
android:layout_below="@+id/button4"
android:layout_marginTop="23dp"
android:text="Custom" />

<Button
android:id="@+id/button8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/button5"
android:layout_alignTop="@+id/button7"
android:text="Android" />
</RelativeLayout>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down

0 comments on commit 7b34c4a

Please sign in to comment.