当前位置: 首页>>代码示例>>Java>>正文


Java CircleButton类代码示例

本文整理汇总了Java中at.markushi.ui.CircleButton的典型用法代码示例。如果您正苦于以下问题:Java CircleButton类的具体用法?Java CircleButton怎么用?Java CircleButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CircleButton类属于at.markushi.ui包,在下文中一共展示了CircleButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // litepal
    Connector.getDatabase();

    // 获得包名和资源,方便后面的程序使用
    PACKAGE_NAME = getApplicationContext().getPackageName();
    resources = getResources();

    showBtn = (Button) findViewById(R.id.show_money_button);
    addBtn = (CircleButton) findViewById(R.id.add_button);
    ioItemRecyclerView = (RecyclerView) findViewById(R.id.in_and_out_items);
    headerImg = (ImageView) findViewById(R.id.header_img);
    monthlyCost = (TextView) findViewById(R.id.monthly_cost_money);
    monthlyEarn = (TextView) findViewById(R.id.monthly_earn_money);

    // 设置按钮监听
    showBtn.setOnClickListener(new ButtonListener());
    addBtn.setOnClickListener(new ButtonListener());

    // 设置首页header图片长按以更换图片
    headerImg.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            selectPictureFromGallery();
            return false;
        }
    });

    setImageForHeader();
}
 
开发者ID:yuukidach,项目名称:Ucount,代码行数:36,代码来源:MainActivity.java

示例2: initView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
private void initView(Context context) {
	View v = LayoutInflater.from(context).inflate(R.layout.view_track_ctrl, 
			this, 
			true);
	
	btnStart = (CircleButton) v.findViewById(R.id.btnStart);
	btnStop = (CircleButton) v.findViewById(R.id.btnStop);
	tvMid1 = (TextView) v.findViewById(R.id.tvMid1);
	tvMid2 = (TextView) v.findViewById(R.id.tvMid2);
	btnStart.setOnClickListener(this);
	btnStop.setOnClickListener(this);
	
	strTrackCtrlDefaultLeft = getResources().getString(R.string.strTrackCtrlDefaultLeft);
	strTrackCtrlDefaultRight = getResources().getString(R.string.strTrackCtrlDefaultRight);
	strTrackCtrlTotalTime = getResources().getString(R.string.strTrackCtrlTotalTime);
	strTrackCtrlTotalDis = getResources().getString(R.string.strTrackCtrlTotalDis);
	strKm = getResources().getString(R.string.strKm);
	strM = getResources().getString(R.string.strM);
	strTrackStopConfirmTitle = getResources().getString(R.string.strTrackStopConfirmTitle);
	strTrackStopConfirmMsg = getResources().getString(R.string.strTrackStopConfirmMsg);
	yellow8= getResources().getColor(R.color.yellow8);
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:23,代码来源:TrackCtrlView.java

示例3: onCreateView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    View rootView = inflater.inflate(R.layout.post_card, container, false);
    message = (TextView) rootView.findViewById(R.id.message);
    titleEdit = (EditText) rootView.findViewById(R.id.title);
    authorEdit = (EditText) rootView.findViewById(R.id.author);
    descriptionEdit = (EditText) rootView.findViewById(R.id.description);
    localityEdit = (EditText) rootView.findViewById(R.id.locality);
    priceEdit = (EditText) rootView.findViewById(R.id.price);
    originalPriceEdit = (EditText) rootView.findViewById(R.id.original_price);
    phoneEdit = (EditText) rootView.findViewById(R.id.contact_no);
    deptSpin = (Spinner) rootView.findViewById(R.id.dept_spinner);
    contactSpin = (Spinner) rootView.findViewById(R.id.cont_spinner);
    tablet = (ImageView) rootView.findViewById(R.id.tablet);
    uploadButton = (CircleButton) rootView.findViewById(R.id.bpost);


    return rootView;
}
 
开发者ID:karnikram,项目名称:seglio,代码行数:21,代码来源:PostCardFragment.java

示例4: init

import at.markushi.ui.CircleButton; //导入依赖的package包/类
private void init(Context context, AttributeSet attributeSet) {
    inflate(getContext(), R.layout.game_control_buttons, this);

    // Get the attributes
    TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.GameControlButtons, 0, 0);
    color = attr.getColor(R.styleable.GameControlButtons_gcb_color, Color.BLACK);
    attr.recycle();

    // Grab the views
    mSound = (ImageButton) findViewById(R.id.sound_button);
    mScreenLock = (ImageButton) findViewById(R.id.screen_on);
    mControl = (CircleButton) findViewById(R.id.timer_control);
    mStop = (ImageButton) findViewById(R.id.timer_stop);

    mIcon = STATE_PLAY_ICON;

    mControl.setColor(color);

}
 
开发者ID:jordond,项目名称:powerhour,代码行数:20,代码来源:GameControlButtons.java

示例5: onCreateView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
/**
 * Inflates the buzzer button view, and configures the button to be activated after a random
 * delay.
 *
 * @param inflater           The LayoutInflater.
 * @param container          The ViewGroup container that will contain the inflated view.
 * @param savedInstanceState The saved instance's state.
 * @return The inflated view.
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_practice_mode_tap, container, false);

    setInstructions(rootView, getString(R.string.practice_session_wait));

    CircleButton button = (CircleButton) rootView.findViewById(R.id.practice_buzzer_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onButtonPressed();
        }
    });
    TimerTask alphaChangeTask = configureBuzzerActivationTask(rootView, button);

    int delay = getRandom(minDelayMilliSeconds, maxDelayMilliseconds);
    timer.schedule(alphaChangeTask, delay);

    return rootView;
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:31,代码来源:PracticeModeTapFragment.java

示例6: getBuzzerButtons

import at.markushi.ui.CircleButton; //导入依赖的package包/类
private ArrayList<Pair<CharSequence, CircleButton>> getBuzzerButtons(View rootView) {
    ArrayList<Pair<CharSequence, CircleButton>> buttons = new ArrayList<>();
    switch (numberOfPlayers) {
        case 2:
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.two_player_player_one, R.id.two_player_buzzer_one));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.two_player_player_two, R.id.two_player_buzzer_two));
            break;
        case 3:
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.three_player_player_one, R.id.three_player_buzzer_one));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.three_player_player_two, R.id.three_player_buzzer_two));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.three_player_player_three, R.id.three_player_buzzer_three));
            break;
        case 4:
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.four_player_player_one, R.id.four_player_buzzer_one));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.four_player_player_two, R.id.four_player_buzzer_two));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.four_player_player_three, R.id.four_player_buzzer_three));
            buttons.add(getBuzzerAndItsDescription(rootView, R.id.four_player_player_four, R.id.four_player_buzzer_four));
            break;
        default:
            throw new UnsupportedOperationException("numberOfPlayers can only be between 2-4.");
    }
    return buttons;
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:24,代码来源:CompeteModeTapFragment.java

示例7: AlarmCardViewHolder

import at.markushi.ui.CircleButton; //导入依赖的package包/类
public AlarmCardViewHolder(View itemView)
{
	super(itemView);

	if (itemView != null)
	{
		alarmTime = (TextView) itemView.findViewById(R.id.textView_alarmTime);
		am_pm = (TextView) itemView.findViewById(R.id.textView_am_pm);
		alarmSet = (CircleButton) itemView.findViewById(R.id.button_alarm_set);
		vibrate = (CheckBox) itemView.findViewById(R.id.checkBox_vibrate);
		repeatAlarm = (CheckBox) itemView.findViewById(R.id.checkBox_repeat_alarm);
		alarmText = (TextView) itemView.findViewById(R.id.textView_alarmText);
		chooseColor = (LinearLayout) itemView.findViewById(R.id.layout_choose_color);
		deletAlarm = (ImageView) itemView.findViewById(R.id.button_deleteAlarm);
		weekdayPanel = (LinearLayout) itemView.findViewById(R.id.layout_weekday_panel);
	}
}
 
开发者ID:AlphaBetaPeter,项目名称:alarming,代码行数:18,代码来源:AlarmCardRecyclerAdapter.java

示例8: configureBuzzerActivationTask

import at.markushi.ui.CircleButton; //导入依赖的package包/类
/**
 * Sets the button alpha to a translucent value, and creates a task to restore it to the original
 * value. Also changes the instructions to {@link c301.udey.udey_reflex.R.string#practice_session_go}.
 *
 * @param rootView The root View.
 * @param button   The buzzer button.
 * @return The created task.
 */
@NonNull
private TimerTask configureBuzzerActivationTask(final View rootView, final CircleButton button) {
    // Prefer Alpha over visibility in this case for registering early taps
    // Source: http://stackoverflow.com/questions/10612740/will-touch-get-detected-while-a-view-is-in-invisible-state
    final float oldAlpha = button.getAlpha();
    button.setAlpha(0.2f);

    return new TimerTask() {

        @Override
        public void run() {
            // Needs to be run on UI thread, else throws CalledFromWrongThreadException
            // Source: http://stackoverflow.com/questions/5161951/android-only-the-original-thread-that-created-a-view-hierarchy-can-touch-its-vi
            // Activity null check for the cases where back button might be pressed, or buzzer
            // is pressed too soon
            FragmentActivity activity = getActivity();
            if (activity != null) {
                activity.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        setInstructions(rootView, getString(R.string.practice_session_go));
                        button.setAlpha(oldAlpha);
                        buttonDisplayedTime = SystemClock.elapsedRealtime();
                    }
                });
            }
        }
    };
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:38,代码来源:PracticeModeTapFragment.java

示例9: getBuzzerAndItsDescription

import at.markushi.ui.CircleButton; //导入依赖的package包/类
private static Pair<CharSequence, CircleButton> getBuzzerAndItsDescription(View rootView,
                                                                           int textViewId,
                                                                           int buzzerId) {
    CharSequence description = ((TextView) rootView.findViewById(textViewId)).getText();
    CircleButton button = (CircleButton) rootView.findViewById(buzzerId);
    return new Pair<>(description, button);
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:8,代码来源:CompeteModeTapFragment.java

示例10: onCreateView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
/**
 * Inflates the appropriate view based on the number of players playing.
 *
 * @param inflater           The LayoutInflater.
 * @param container          The ViewGroup container that will contain the inflated view.
 * @param savedInstanceState The saved instance's state.
 * @return The inflated view.
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflateProperLayout(inflater, container);
    ArrayList<Pair<CharSequence, CircleButton>> buttons = getBuzzerButtons(rootView);
    registerBuzzerCallbacks(buttons);
    return rootView;
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:17,代码来源:CompeteModeTapFragment.java

示例11: registerBuzzerCallbacks

import at.markushi.ui.CircleButton; //导入依赖的package包/类
/**
 * Since all the buzzer buttons are symmetrical, this method registers callbacks with the same logic
 * to all the buttons. The CharSequence (i.e., label) corresponding to these buttons should be used
 * to identify the source of the callback.
 *
 * @param buttons The list of buttons.
 */
private void registerBuzzerCallbacks(List<Pair<CharSequence, CircleButton>> buttons) {
    for (final Pair<CharSequence, CircleButton> button : buttons) {
        button.second.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onButtonPressed(button.first);
            }
        });
    }
}
 
开发者ID:udeyrishi,项目名称:reflex-android,代码行数:18,代码来源:CompeteModeTapFragment.java

示例12: onCreateView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view           = inflater.inflate(R.layout.fragment_player_controller, container, false);
  timeSeekBar         = (SeekBar)view.findViewById(R.id.seek_bar_player);
  runningTextView     = (TextView)view.findViewById(R.id.text_running_time);
  totalRunnigTextView = (TextView)view.findViewById(R.id.text_running_total_time);
  playPauseButton     = (CircleButton)view.findViewById(R.id.button_play_pause);
  loadingProgress     = (ProgressBar)view.findViewById(R.id.progress_loading);

  playPauseButton.setOnClickListener(this);
  timeSeekBar.setOnSeekBarChangeListener(this);
  return view;
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:14,代码来源:PlayerControllerFragment.java

示例13: onCreateView

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_player_info, container, false);

  this.playPauseButton        = (CircleButton) view.findViewById(R.id.button_play_pause);
  this.artworkImageView       = (ImageView)view.findViewById(R.id.player_artwork);
  this.titleTextView          = (TextView) view.findViewById(R.id.player_name);
  this.timeTextView           = (TextView) view.findViewById(R.id.player_time);
  this.actionFrame            = view.findViewById(R.id.player_frame);
  this.loadingProgress        = (ProgressBar) view.findViewById(R.id.progress_loading);
  playPauseButton.setOnClickListener(this);
  actionFrame.setOnClickListener(this);
  return view;
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:15,代码来源:ExternalPlayerFragment.java

示例14: onExpand

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@Optional
@OnClick(R.id.expand)
public void onExpand(CircleButton button) {
    if (mFabListener != null) {
        mFabListener.onButtonClicked(button);
    }
}
 
开发者ID:bhm,项目名称:Cthulhator,代码行数:8,代码来源:TitleCardHolder.java

示例15: onDoneClick

import at.markushi.ui.CircleButton; //导入依赖的package包/类
@OnClick(android.R.id.closeButton)
public void onDoneClick(CircleButton button) {
    Intent i = new Intent(this, CharactersListActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(i);
    overridePendingTransition(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_top);
}
 
开发者ID:bhm,项目名称:Cthulhator,代码行数:8,代码来源:ConfigurationActivity.java


注:本文中的at.markushi.ui.CircleButton类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。