本文整理汇总了Java中com.jaredrummler.materialspinner.MaterialSpinner类的典型用法代码示例。如果您正苦于以下问题:Java MaterialSpinner类的具体用法?Java MaterialSpinner怎么用?Java MaterialSpinner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialSpinner类属于com.jaredrummler.materialspinner包,在下文中一共展示了MaterialSpinner类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_list_open_bills, container, false);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view_open);
recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.getContext());
recyclerView.setLayoutManager(linearLayoutManager);
MaterialSpinner spinner = (MaterialSpinner) view.findViewById(R.id.spinner_open);
spinner.setItems("Relevantes", "Recentes");
spinner.setOnItemSelectedListener(this);
initBillList();
recyclerViewAdapter = new RecyclerViewAdapter(billListInitial);
recyclerView.setAdapter(recyclerViewAdapter);
return view;
}
开发者ID:fga-gpp-mds,项目名称:2016.2-WikiLegis,代码行数:24,代码来源:OpenBillsListFragment.java
示例2: onCreateView
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_list_closed_bills, container, false);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view_closed);
recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.getContext());
recyclerView.setLayoutManager(linearLayoutManager);
MaterialSpinner spinner = (MaterialSpinner) view.findViewById(R.id.spinner_closed);
spinner.setItems("Relevantes", "Recentes");
spinner.setOnItemSelectedListener(this);
initBillList();
recyclerViewAdapter = new RecyclerViewAdapter(billListInitial);
recyclerView.setAdapter(recyclerViewAdapter);
return view;
}
开发者ID:fga-gpp-mds,项目名称:2016.2-WikiLegis,代码行数:24,代码来源:ClosedBillsListFragment.java
示例3: onCreate
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
int permissionCheck = ContextCompat.checkSelfPermission(this,
Manifest.permission.RECORD_AUDIO);
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECORD_AUDIO}, RECORD_AUDIO_PERMISSION);
} else {
startRecording();
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MaterialSpinner spinner = findViewById(R.id.tuning);
ArrayAdapter<CharSequence> adapter = createFromResource(this,
R.array.tunings, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
myToolbar.setTitle(R.string.app_name);
myToolbar.showOverflowMenu();
setSupportActionBar(myToolbar);
}
开发者ID:gstraube,项目名称:cythara,代码行数:30,代码来源:MainActivity.java
示例4: onItemSelected
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item){
if(item.equals("Relevantes")){
recyclerViewAdapter.getData().clear();
recyclerViewAdapter.getData().addAll(billListRelevantsAndOpened);
recyclerViewAdapter.notifyDataSetChanged();
}
else if(item.equals("Recentes")){
recyclerViewAdapter.getData().clear();
recyclerViewAdapter.getData().addAll(billListRecentsAndOpened);
recyclerViewAdapter.notifyDataSetChanged();
}
}
开发者ID:fga-gpp-mds,项目名称:2016.2-WikiLegis,代码行数:14,代码来源:OpenBillsListFragment.java
示例5: onItemSelected
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item){
if(item.equals("Relevantes")){
recyclerViewAdapter.getData().clear();
recyclerViewAdapter.getData().addAll(billListRelevantsAndClosed);
recyclerViewAdapter.notifyDataSetChanged();
}
else{
recyclerViewAdapter.getData().clear();
recyclerViewAdapter.getData().addAll(billListRecentsAndClosed);
recyclerViewAdapter.notifyDataSetChanged();
}
}
开发者ID:fga-gpp-mds,项目名称:2016.2-WikiLegis,代码行数:14,代码来源:ClosedBillsListFragment.java
示例6: initLanguage
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
private void initLanguage(){
List<String> languages = TranslationUtil.getLanguages();
int languageIndex = 0;
if(languageCode == null){
languageCode = LanguageUtil.getCurrentLanguageCode(getContext());
}
for (int i = 0; i < languages.size(); i++){
if(languages.get(i).equals(LanguageUtil.languageCodeToLanguage(getContext(), languageCode))){
languageIndex = i;
}
}
languageView.setTextColor(Color.BLACK);
languageView.setArrowColor(Color.BLACK);
languageView.setBackground(null);
languageView.setPadding(20, 20, 20, 20);
languageView.setItems(languages);
languageView.setSelectedIndex(languageIndex);
languageView.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
languageCode = TranslationUtil.updateLanguageFlag(getContext(), languageView, item);
translatePhrase();
}
});
languageCode = TranslationUtil.updateLanguageFlag(getContext(), languageView, languageCode);
}
开发者ID:adrielcafe,项目名称:NMSAlphabetAndroidApp,代码行数:30,代码来源:TranslateFragment.java
示例7: updateLanguageFlag
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
public static String updateLanguageFlag(Context context, MaterialSpinner languageView, String language){
String languageCode = null;
int flagResId = -1;
try {
if(language.equals("en") || language.equals("English")){
languageCode = "en";
flagResId = R.drawable.flag_en_small;
} else if(language.equals("pt") || language.equals("Português")){
languageCode = "pt";
flagResId = R.drawable.flag_pt_small;
} else if(language.equals("de") || language.equals("Deutsch")){
languageCode = "de";
flagResId = R.drawable.flag_de_small;
} else if(language.equals("it") || language.equals("Italiano")){
languageCode = "it";
flagResId = R.drawable.flag_it_small;
} else if(language.equals("fr") || language.equals("Français")){
languageCode = "fr";
flagResId = R.drawable.flag_fr_small;
} else if(language.equals("es") || language.equals("Español")){
languageCode = "es";
flagResId = R.drawable.flag_es_small;
} else if(language.equals("nl") || language.equals("Nederlandse")){
languageCode = "nl";
flagResId = R.drawable.flag_nl_small;
} else if(language.equals("ru") || language.equals("Pусский")){
languageCode = "ru";
flagResId = R.drawable.flag_ru_small;
} else if(language.equals("ja") || language.equals("日本語")){
languageCode = "ja";
flagResId = R.drawable.flag_ja_small;
} else if(language.equals("ko") || language.equals("한국말")){
languageCode = "ko";
flagResId = R.drawable.flag_ko_small;
}
languageView.setCompoundDrawablesWithIntrinsicBounds(
context.getResources().getDrawable(flagResId), null, languageView.getCompoundDrawables()[2], null);
} catch (Exception e){ }
return languageCode;
}
开发者ID:adrielcafe,项目名称:NMSAlphabetAndroidApp,代码行数:41,代码来源:TranslationUtil.java
示例8: onItemSelected
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
Technique.FADE_OUT.getComposer().duration(500).hideOnFinished().playOn(backgroundShadow);
if (item.equals(getString(R.string.choose_a_directory))) {
DirectoryPickerDialog.show(getActivity(), new LocalFile("/"));
} else {
pathIndex = view.getSelectedIndex();
updateDiskUsagePieChart();
}
}
开发者ID:jrummyapps,项目名称:BusyBox,代码行数:10,代码来源:InstallerFragment.java
示例9: init
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public void init(Bundle savedInstanceState) {
setupLayout(R.layout.activity_gpms_pass_apply, "Apply for a pass", Color.parseColor("#009688"));
passType = getIntent().getStringExtra("pass_type");
List<String> dataset = new LinkedList<>(Arrays.asList("Regular Academic Semester", "Project during vacation", "Training", "Cultural/Club", "Vacation Course"));
spinner = (MaterialSpinner) findViewById(R.id.spinner);
spinner.setItems(dataset);
fromDateBtn = (Button) findViewById(R.id.from_date_btn);
toDateBtn = (Button) findViewById(R.id.to_date_btn);
reasonEditText = (EditText) findViewById(R.id.reason);
if (passType.equals("Day Pass")) {
toDateBtn.setVisibility(View.GONE);
findViewById(R.id.required_till_text).setVisibility(View.GONE);
}
SharedPreferences preferences = getSharedPreferences("gpms_prefs", Context.MODE_PRIVATE);
String rollNo = preferences.getString("roll_no", "");
String password = Security.decrypt(preferences.getString("password", ""), MainApplication.key);
gpms = new Gpms(baseContext);
((Button) findViewById(R.id.apply_pass)).setText("Apply for " + passType);
dialog = new ProgressDialog(baseContext);
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.setInverseBackgroundForced(false);
dialog.setCanceledOnTouchOutside(false);
dialog.setMessage("Applying ...");
}
开发者ID:niranjan94,项目名称:amrita-info-desk,代码行数:36,代码来源:PassApplyActivity.java
示例10: initView
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
/**
* 初始化控y件
*/
private void initView() {
tvTitle.setText(misNewOreder ? "新建普通工单" : "新建故障工单");
tvarea.setItems(selectArea);
int userAreaid = SharedPreferenceHelper.getUserAreaid();
for (int i = 0; i < selectArea.size(); i++) {
if (userAreaid==selectAreaIds.get(i)) {
tvarea.setSelectedIndex(i);
selectAreaId = beanData.get(i).getId();
break;
}
}
tvarea.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener() {
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {
tareaName = selectArea.get(position);
selectAreaId = beanData.get(position).getId();
}
});
//mTypey.setItems(selectType);
//mTypey.setSelectedIndex(0);
typeName = selectType[0];
//mTypey.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener() {
// @Override
// public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {
// typeName = selectType[position];
// }
//});
}
开发者ID:binarylife,项目名称:Ydkd,代码行数:32,代码来源:AddWorkOrderActivity.java
示例11: onItemSelected
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {
tuning = getTuningFromPosition(position);
}
开发者ID:gstraube,项目名称:cythara,代码行数:5,代码来源:MainActivity.java
示例12: onNothingSelected
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
@Override public void onNothingSelected(MaterialSpinner spinner) {
Technique.FADE_OUT.getComposer().duration(500).hideOnFinished().playOn(backgroundShadow);
}
开发者ID:jrummyapps,项目名称:BusyBox,代码行数:4,代码来源:InstallerFragment.java
示例13: initView
import com.jaredrummler.materialspinner.MaterialSpinner; //导入依赖的package包/类
/**
* 初始化控件
*/
private void initView() {
selectAreaId = beanData.get(0).getId();
tvarea.setItems(selectArea);
tvarea.setSelectedIndex(0);
tvarea.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener() {
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {
tareaName = selectArea.get(position);
selectAreaId = beanData.get(position).getId();
}
});
//mTypey.setItems(selectType);
//mTypey.setSelectedIndex(0);
if (SharedPreferenceHelper.getUserRole().equals("B")) {
llArea.setVisibility(View.VISIBLE);
tvSaveArea.setVisibility(View.VISIBLE);
} else {
llArea.setVisibility(View.GONE);
}
mArea.setText(orderDetialBean.getArea());
account.setText(orderDetialBean.getAccount());
phone.setText(orderDetialBean.getPhone());
address.setText(orderDetialBean.getAddress());
dispatchPeople.setText(orderDetialBean.getDispatchPeople());
interfacePeople.setText(orderDetialBean.getInterfacePeople());
dispatchTime.setText(orderDetialBean.getDispatchTime());
installPeople.setText(orderDetialBean.getInstallPeople());
taketime.setText(orderDetialBean.getTakeTime());
installTime.setText(orderDetialBean.getInstallTime());
overTime.setText(orderDetialBean.getOverTime());
dispatchduration.setText(orderDetialBean.getDispatchDuration() + "");
installduration.setText(orderDetialBean.getInstallDuration() + "");
visitduration.setText(orderDetialBean.getVisitDuration() + "");
dispatchwaring.setText(orderDetialBean.getDispatchWarning() + "");
installwarning.setText(orderDetialBean.getInstallWarning() + "");
visitwarning.setText(orderDetialBean.getVisitWarning() + "");
repeatnum.setText(orderDetialBean.getRepeatNum() + "");
iscancle.setText(orderDetialBean.getIsCancel() + "");
isend.setText(orderDetialBean.getIsEnd() + "");
status.setText(MyUtils.getTextByType(orderDetialBean.getStatus()));
statusValue = orderDetialBean.getStatus();
if (!misSearch) {
showBottomButton();
} else {
ll_bottom.setVisibility(View.GONE);
}
dispatchPeople21.setText(orderDetialBean.getDispatchPeople21());;
dispatchPeople22.setText(orderDetialBean.getDispatchPeople22());;
dispatchTime21.setText(orderDetialBean.getDispatchTime21());;
dispatchTime22.setText(orderDetialBean.getDispatchTime22());;
dispatchWarning1.setText(orderDetialBean.getDispatchWarning1()+"");;
dispatchWarning2.setText(orderDetialBean.getDispatchWarning2()+"");;
dispatchDuration21.setText(orderDetialBean.getDispatchDuration21()+"");;
dispatchDuration22.setText(orderDetialBean.getDispatchDuration22()+"");;
}
开发者ID:binarylife,项目名称:Ydkd,代码行数:59,代码来源:FixOrderDetialActivity.java
注:本文中的com.jaredrummler.materialspinner.MaterialSpinner类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论