Search in sources :

Example 1 with ColorSelector

use of com.gc.materialdesign.widgets.ColorSelector in project UltimateAndroid by cymcsg.

the class MaterialDesignActivity method onCreate.

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.material_design_activity_main);
    buttonSelectColor = (ButtonFloatSmall) findViewById(R.id.buttonColorSelector);
    buttonSelectColor.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            ColorSelector colorSelector = new ColorSelector(MaterialDesignActivity.this, backgroundColor, MaterialDesignActivity.this);
            colorSelector.show();
        }
    });
    LayoutRipple layoutRipple = (LayoutRipple) findViewById(R.id.itemButtons);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MaterialDesignActivity.this, ButtonsActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemSwitches);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MaterialDesignActivity.this, SwitchActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemProgress);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MaterialDesignActivity.this, ProgressActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemWidgets);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MaterialDesignActivity.this, WidgetActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
}
Also used : LayoutRipple(com.gc.materialdesign.views.LayoutRipple) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ColorSelector(com.gc.materialdesign.widgets.ColorSelector) View(android.view.View) SuppressLint(android.annotation.SuppressLint)

Example 2 with ColorSelector

use of com.gc.materialdesign.widgets.ColorSelector in project MaterialDesignLibrary by navasmdc.

the class WidgetActivity method onCreate.

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_widgets);
    // SHOW SNACKBAR
    findViewById(R.id.buttonSnackBar).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            new SnackBar(WidgetActivity.this, "Do you want change color of this button to red?", "yes", new OnClickListener() {

                @Override
                public void onClick(View v) {
                    ButtonFlat btn = (ButtonFlat) findViewById(R.id.buttonSnackBar);
                    btn.setTextColor(Color.RED);
                }
            }).show();
        }
    });
    // SHOW DiALOG
    findViewById(R.id.buttonDialog).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            Dialog dialog = new Dialog(WidgetActivity.this, "Title", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam");
            dialog.setOnAcceptButtonClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    Toast.makeText(WidgetActivity.this, "Click accept button", 1).show();
                }
            });
            dialog.setOnCancelButtonClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    Toast.makeText(WidgetActivity.this, "Click cancel button", 1).show();
                }
            });
            dialog.show();
        }
    });
    // SHOW COLOR SEECTOR
    findViewById(R.id.buttonColorSelector).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            new ColorSelector(WidgetActivity.this, Color.RED, null).show();
        }
    });
}
Also used : ButtonFlat(com.gc.materialdesign.views.ButtonFlat) Dialog(com.gc.materialdesign.widgets.Dialog) OnClickListener(android.view.View.OnClickListener) SnackBar(com.gc.materialdesign.widgets.SnackBar) ColorSelector(com.gc.materialdesign.widgets.ColorSelector) View(android.view.View) SuppressLint(android.annotation.SuppressLint)

Example 3 with ColorSelector

use of com.gc.materialdesign.widgets.ColorSelector in project MaterialDesignLibrary by navasmdc.

the class MainActivity method onCreate.

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    buttonSelectColor = (ButtonFloatSmall) findViewById(R.id.buttonColorSelector);
    buttonSelectColor.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            ColorSelector colorSelector = new ColorSelector(MainActivity.this, backgroundColor, MainActivity.this);
            colorSelector.show();
        }
    });
    LayoutRipple layoutRipple = (LayoutRipple) findViewById(R.id.itemButtons);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MainActivity.this, ButtonsActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemSwitches);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MainActivity.this, SwitchActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemProgress);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MainActivity.this, ProgressActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
    layoutRipple = (LayoutRipple) findViewById(R.id.itemWidgets);
    setOriginRiple(layoutRipple);
    layoutRipple.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(MainActivity.this, WidgetActivity.class);
            intent.putExtra("BACKGROUND", backgroundColor);
            startActivity(intent);
        }
    });
}
Also used : LayoutRipple(com.gc.materialdesign.views.LayoutRipple) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ColorSelector(com.gc.materialdesign.widgets.ColorSelector) View(android.view.View) SuppressLint(android.annotation.SuppressLint)

Example 4 with ColorSelector

use of com.gc.materialdesign.widgets.ColorSelector in project UltimateAndroid by cymcsg.

the class WidgetActivity method onCreate.

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.material_design_activity_widgets);
    //		SHOW SNACKBAR
    findViewById(R.id.buttonSnackBar).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            new SnackBar(WidgetActivity.this, "Do you want change color of this button to red?", "yes", new OnClickListener() {

                @Override
                public void onClick(View v) {
                    ButtonFlat btn = (ButtonFlat) findViewById(R.id.buttonSnackBar);
                    btn.setTextColor(Color.RED);
                }
            }).show();
        }
    });
    //		SHOW DiALOG
    findViewById(R.id.buttonDialog).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            Dialog dialog = new Dialog(WidgetActivity.this, "Title", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam");
            dialog.setOnAcceptButtonClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    Toast.makeText(WidgetActivity.this, "Click accept button", Toast.LENGTH_LONG).show();
                }
            });
            dialog.setOnCancelButtonClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    Toast.makeText(WidgetActivity.this, "Click cancel button", Toast.LENGTH_LONG).show();
                }
            });
            dialog.show();
        }
    });
    //		SHOW COLOR SEECTOR
    findViewById(R.id.buttonColorSelector).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View flatButton) {
            new ColorSelector(WidgetActivity.this, Color.RED, null).show();
        }
    });
}
Also used : ButtonFlat(com.gc.materialdesign.views.ButtonFlat) Dialog(com.gc.materialdesign.widgets.Dialog) OnClickListener(android.view.View.OnClickListener) SnackBar(com.gc.materialdesign.widgets.SnackBar) ColorSelector(com.gc.materialdesign.widgets.ColorSelector) View(android.view.View) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)4 View (android.view.View)4 OnClickListener (android.view.View.OnClickListener)4 ColorSelector (com.gc.materialdesign.widgets.ColorSelector)4 Intent (android.content.Intent)2 ButtonFlat (com.gc.materialdesign.views.ButtonFlat)2 LayoutRipple (com.gc.materialdesign.views.LayoutRipple)2 Dialog (com.gc.materialdesign.widgets.Dialog)2 SnackBar (com.gc.materialdesign.widgets.SnackBar)2