本文整理汇总了Java中info.hoang8f.android.segmented.SegmentedGroup类的典型用法代码示例。如果您正苦于以下问题:Java SegmentedGroup类的具体用法?Java SegmentedGroup怎么用?Java SegmentedGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SegmentedGroup类属于info.hoang8f.android.segmented包,在下文中一共展示了SegmentedGroup类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateDialog
import info.hoang8f.android.segmented.SegmentedGroup; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
// Get the layout inflater
LayoutInflater inflater = getActivity().getLayoutInflater();
@SuppressLint("InflateParams") View view = inflater.inflate(R.layout.fragment_send_schedule_dialog, null);
setCurrentDateAndTime(view);
builder.setCancelable(false);
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
builder.setView(view);
SegmentedGroup typeSG = (SegmentedGroup) view.findViewById(R.id.type_sg);
distanceRadio = (RadioButton) view.findViewById(R.id.distance_radio);
typeSG.setOnCheckedChangeListener(this);
view.findViewById(R.id.schedule_positive_btn).setOnClickListener(this);
view.findViewById(R.id.schedule_negative_btn).setOnClickListener(this);
distanceRadio.performClick();
dialog = builder.create();
return dialog;
}
示例2: initializeGUI
import info.hoang8f.android.segmented.SegmentedGroup; //导入依赖的package包/类
private void initializeGUI() {
seggroupDisplay = (SegmentedGroup) view.findViewById(R.id.seggroupDisplay);
rbtnCalories = (RadioButton) view.findViewById(R.id.rbtnCalories);
rbtnMacros = (RadioButton) view.findViewById(R.id.rbtnMacros);
etxtCalories = (EditText) view.findViewById(R.id.etxtCalories);
etxtCarbs = (EditText) view.findViewById(R.id.etxtCarbs);
etxtProtein = (EditText) view.findViewById(R.id.etxtProtein);
etxtFat = (EditText) view.findViewById(R.id.etxtFat);
lblPlus1 = (TextView) view.findViewById(R.id.lblPlus1);
lblPlus2 = (TextView) view.findViewById(R.id.lblPlus2);
lblUnit1 = (TextView) view.findViewById(R.id.lblUnit1);
lblUnit2 = (TextView) view.findViewById(R.id.lblUnit2);
lblUnit3 = (TextView) view.findViewById(R.id.lblUnit3);
lblEqual = (TextView) view.findViewById(R.id.lblEqual);
lblCarbs = (TextView) view.findViewById(R.id.lblCarbs);
lblProtein = (TextView) view.findViewById(R.id.lblProtein);
lblFat = (TextView) view.findViewById(R.id.lblFat);
lblTotal = (TextView) view.findViewById(R.id.lblTotal);
lblAmountTotal = (TextView) view.findViewById(R.id.lblAmountTotal);
lblValueCarbs = (TextView) view.findViewById(R.id.lblValueCarbs);
lblValueProtein = (TextView) view.findViewById(R.id.lblValueProtein);
lblValueFat = (TextView) view.findViewById(R.id.lblValueFat);
btnReset = (ImageButton) view.findViewById(R.id.btnReset);
btnInfo = (ImageButton) view.findViewById(R.id.btnInfo);
linearLayoutRoot = (LinearLayout) view.findViewById(R.id.linearLayoutRoot);
btnReset.setOnClickListener(this);
btnInfo.setOnClickListener(this);
// setup enter and exit animation
mEnterAnimation = new AlphaAnimation(0f, 1f);
mEnterAnimation.setDuration(600);
mEnterAnimation.setFillAfter(true);
mExitAnimation = new AlphaAnimation(1f, 0f);
mExitAnimation.setDuration(600);
mExitAnimation.setFillAfter(true);
goalsChangesSynced.setListener(new ChangesSynced.ChangeListener() {
@Override
public void onChange() {
Log.d("goalsChangesSynced", goalsChangesSynced.isSynced() + "");
}
});
}
示例3: initializeGUI
import info.hoang8f.android.segmented.SegmentedGroup; //导入依赖的package包/类
private void initializeGUI() {
seggroupDisplay = (SegmentedGroup) findViewById(R.id.seggroupDisplay);
rbtnCalories = (RadioButton) findViewById(R.id.rbtnCalories);
rbtnMacros = (RadioButton) findViewById(R.id.rbtnMacros);
etxtCalories = (EditText) findViewById(R.id.etxtCalories);
etxtCarbs = (EditText) findViewById(R.id.etxtCarbs);
etxtProtein = (EditText) findViewById(R.id.etxtProtein);
etxtFat = (EditText) findViewById(R.id.etxtFat);
lblPlus1 = (TextView) findViewById(R.id.lblPlus1);
lblPlus2 = (TextView) findViewById(R.id.lblPlus2);
lblUnit1 = (TextView) findViewById(R.id.lblUnit1);
lblUnit2 = (TextView) findViewById(R.id.lblUnit2);
lblUnit3 = (TextView) findViewById(R.id.lblUnit3);
lblEqual = (TextView) findViewById(R.id.lblEqual);
lblCarbs = (TextView) findViewById(R.id.lblCarbs);
lblProtein = (TextView) findViewById(R.id.lblProtein);
lblFat = (TextView) findViewById(R.id.lblFat);
lblTotal = (TextView) findViewById(R.id.lblTotal);
lblAmountTotal = (TextView) findViewById(R.id.lblAmountTotal);
lblValueCarbs = (TextView) findViewById(R.id.lblValueCarbs);
lblValueProtein = (TextView) findViewById(R.id.lblValueProtein);
lblValueFat = (TextView) findViewById(R.id.lblValueFat);
btnReset = (ImageButton) findViewById(R.id.btnReset);
btnInfo = (ImageButton) findViewById(R.id.btnInfo);
seggroupDisplay.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
updateGUI();
defaultValues();
}});
addTextWatchers();
btnReset.setOnClickListener(this);
btnInfo.setOnClickListener(this);
// setup enter and exit animation
mEnterAnimation = new AlphaAnimation(0f, 1f);
mEnterAnimation.setDuration(600);
mEnterAnimation.setFillAfter(true);
mExitAnimation = new AlphaAnimation(1f, 0f);
mExitAnimation.setDuration(600);
mExitAnimation.setFillAfter(true);
}
示例4: initializeGUI
import info.hoang8f.android.segmented.SegmentedGroup; //导入依赖的package包/类
private void initializeGUI() {
etxtName = (EditText)findViewById(R.id.etxtName);
etxtDateOfBirth = (EditText) findViewById(R.id.etxtDateOfBirth);
etxtWeight = (EditText)findViewById(R.id.etxtWeight);
etxtHeightParam1 = (EditText)findViewById(R.id.etxtHeightParam1);
etxtHeightParam2 = (EditText)findViewById(R.id.etxtHeightParam2);
lblWeightUnit = (TextView)findViewById(R.id.lblWeightUnit);
lblHeightUnit1 = (TextView)findViewById(R.id.lblHeightUnit1);
lblHeightUnit2 = (TextView)findViewById(R.id.lblHeightUnit2);
linearlayoutHeight = (LinearLayout)findViewById(R.id.linearlayoutHeight);
linearlayoutWeight = (LinearLayout)findViewById(R.id.linearlayoutWeight);
seggroupUnitSystem = (SegmentedGroup) findViewById(R.id.seggroupUnitSystem);
rbtnGenderMale = (RadioButton)findViewById(R.id.rbtnGenderMale);
rbtnGenderFemale = (RadioButton)findViewById(R.id.rbtnGenderFemale);
rbtnMetric = (RadioButton)findViewById(R.id.rbtnMetric);
rbtnGenderImperial = (RadioButton)findViewById(R.id.rbtnImperial);
spinnerWorkoutFreq = (Spinner)findViewById(R.id.spinnerWorkoutFreq);
spinnerGoals = (Spinner)findViewById(R.id.spinnerGoals);
etxtDateOfBirth.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(hasFocus){
showDatePicker();
}
}
});
dateFormatter = new SimpleDateFormat("dd-MM-yyyy");
etxtDateOfBirth.setInputType(InputType.TYPE_NULL);
etxtDateOfBirth.setText(dateFormatter.format(new Date()));
etxtDateOfBirth.setOnClickListener(this);
seggroupUnitSystem.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
unitSystemChange();
}
});
ArrayAdapter<CharSequence> adapterWorkoutFreq = ArrayAdapter.createFromResource(this,
R.array.array_WorkoutFreq, R.layout.spinner_item);
adapterWorkoutFreq.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
ArrayAdapter<CharSequence> adapterGoals = ArrayAdapter.createFromResource(this,
R.array.array_Goals, R.layout.spinner_item);
adapterGoals.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerWorkoutFreq.setAdapter(adapterWorkoutFreq);
spinnerGoals.setAdapter(adapterGoals);
}
示例5: getSegmentedGroup
import info.hoang8f.android.segmented.SegmentedGroup; //导入依赖的package包/类
public SegmentedGroup getSegmentedGroup() {
return segmentedGroup;
}