Skip to content

Instantly share code, notes, and snippets.

@thiagoolsilva
Last active August 16, 2017 02:18
Show Gist options
  • Save thiagoolsilva/a5b0049b6b79d0826045abc6bdc85548 to your computer and use it in GitHub Desktop.
Save thiagoolsilva/a5b0049b6b79d0826045abc6bdc85548 to your computer and use it in GitHub Desktop.
It create a dummy custom button only for be used on an example of my blog
/*
* Copyright (C) 2017 Thiago lopes da Silva
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package br.org.sidi.butler.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
/**
* The type Login button.
*/
public class LoginButton extends Button {
/**
* The enum Dummy status.
*/
public enum DummyStatus {
/**
* Unknown dummy status.
*/
UNKNOWN, /**
* Error dummy status.
*/
ERROR
}
// This propery will be used only for show how to use a custom matcher on espresso
private DummyStatus dummyLoginStatus = DummyStatus.UNKNOWN;
/**
* Instantiates a new Login button.
*
* @param context the context
*/
public LoginButton(Context context) {
super(context);
}
/**
* Instantiates a new Login button.
*
* @param context the context
* @param attrs the attrs
*/
public LoginButton(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
* Instantiates a new Login button.
*
* @param context the context
* @param attrs the attrs
* @param defStyleAttr the def style attr
*/
public LoginButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
/**
* Instantiates a new Login button.
*
* @param context the context
* @param attrs the attrs
* @param defStyleAttr the def style attr
* @param defStyleRes the def style res
*/
public LoginButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
/**
* Sets dummy login status.
*
* @param dummyStatus the dummy status
*/
public void setDummyLoginStatus(DummyStatus dummyStatus) {
this.dummyLoginStatus = dummyStatus;
}
/**
* Gets dummy login status.
*
* @return the dummy login status
*/
public DummyStatus getDummyLoginStatus() {
return this.dummyLoginStatus;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment