use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.
the class StorySettingFragment method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (getContext() == null)
return super.onCreateView(inflater, container, savedInstanceState);
HelperToolbar helperToolbar = HelperToolbar.create();
String title = getResources().getString(R.string.stories_setting);
View toolBar = helperToolbar.setContext(getContext()).setLogoShown(true).setListener(this).setLeftIcon(R.string.icon_back).setDefaultTitle(getString(R.string.stories_setting)).setDefaultTitle(title).getView();
FrameLayout rootView = new FrameLayout(getContext());
rootView.setBackgroundColor(Theme.getInstance().getDividerColor(getContext()));
rootView.addView(toolBar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP));
rootView.addView(recyclerListView = new RecyclerListView(getContext()), LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.TOP, 0, LayoutCreator.getDimen(R.dimen.toolbar_height), 0, 0));
recyclerListView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
recyclerListView.setAdapter(new ListAdapter());
recyclerListView.setClipToPadding(false);
recyclerListView.setPadding(0, 0, 0, LayoutCreator.dp(30));
return rootView;
}
use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.
the class ViewUserDialogFragment method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
isInShowViewUser = true;
if (tfMain == null)
tfMain = ResourcesCompat.getFont(getContext(), R.font.main_font);
rootView = new FrameLayout(getContext());
dataRootView = new LinearLayout(getContext());
dataRootView.setOrientation(LinearLayout.VERTICAL);
rootView.addView(dataRootView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER));
if (G.themeColor == Theme.DARK) {
rootView.setBackgroundColor(new Theme().getPrimaryDarkColor(getContext()));
} else {
rootView.setBackgroundColor(Theme.getInstance().getDividerColor(getContext()));
}
HelperToolbar helperToolbar = HelperToolbar.create();
View toolBar = helperToolbar.setContext(getContext()).setLogoShown(true).setListener(this).setDefaultTitle(G.selectedLanguage.equals("fa") ? getString(R.string.story_viewed_by) + " " + HelperCalander.convertToUnicodeFarsiNumber(String.valueOf(count)) + " " + getString(R.string.story_person) : getString(R.string.story_viewed_by) + " " + count).getView();
dataRootView.addView(toolBar, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER | Gravity.TOP, 0, 0, 0, 0));
recyclerView = new RecyclerView(getContext());
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
dataRootView.addView(recyclerView, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, 0, 1F, Gravity.CENTER));
progressBar = new ProgressBar(getContext());
progressBar.setVisibility(View.GONE);
rootView.addView(progressBar, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER | Gravity.BOTTOM));
listAdapter = new ListAdapter();
listAdapter.setContext(getContext());
return rootView;
}
use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.
the class BeepTunesMainFragment method initToolBar.
private void initToolBar(ViewGroup viewGroup) {
HelperToolbar helperToolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setSearchBoxShown(true).setLogoShown(true).setListener(this).setRightSmallAvatarShown(true).setLeftIcon(R.string.icon_back);
viewGroup.addView(helperToolbar.getView());
avatarHandler.getAvatar(new ParamWithAvatarType(helperToolbar.getAvatarSmall(), AccountManager.getInstance().getCurrentUser().getId()).avatarType(AvatarHandler.AvatarType.USER).showMain());
}
use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.
the class ElectricityBillListFrag method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
HelperToolbar mHelperToolbar = HelperToolbar.create().setContext(getContext()).setLeftIcon(R.string.icon_back).setLifecycleOwner(getViewLifecycleOwner()).setListener(new ToolbarListener() {
@Override
public void onLeftIconClickListener(View view) {
popBackStackFragment();
}
@Override
public void onRightIconClickListener(View view) {
List<Integer> items = new ArrayList<>();
items.add(R.string.elecBill_cell_deleteAccount);
new TopSheetDialog(getContext()).setListDataWithResourceId(items, -1, position -> {
if (position == 0) {
final MaterialDialog dialog = new MaterialDialog.Builder(getActivity()).title(R.string.elecBill_deleteAccount_title).content(R.string.elecBill_deleteAccount_desc).positiveText(R.string.elecBill_deleteAccount_pos).negativeText(R.string.elecBill_deleteAccount_neg).positiveColor(getContext().getResources().getColor(R.color.red)).widgetColor(new Theme().getAccentColor(getContext())).onPositive((dialog1, which) -> viewModel.deleteAccount()).build();
dialog.show();
}
}).show();
}
}).setLogoShown(true);
LinearLayout toolbarLayout = binding.Toolbar;
toolbarLayout.addView(mHelperToolbar.getView());
binding.billRecycler.setHasFixedSize(true);
onDataChangedListener();
viewModel.getBillsList();
}
use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.
the class ElectricityBillMainFrag method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
HelperTracker.sendTracker(HelperTracker.TRACKER_BILL_PAGE);
HelperToolbar mHelperToolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLeftIcon(R.string.icon_back).setListener(new ToolbarListener() {
@Override
public void onLeftIconClickListener(View view) {
popBackStackFragment();
}
}).setLogoShown(true);
LinearLayout toolbarLayout = binding.Toolbar;
toolbarLayout.addView(mHelperToolbar.getView());
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getContext(), R.array.billsOptions, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
binding.billSpinner.setAdapter(adapter);
binding.billSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch(position) {
case 0:
viewModel.setType(BillInfo.BillType.ELECTRICITY);
binding.billIdHolder.setHint(getResources().getString(R.string.elecBill_main_billIDHint));
binding.billIdHolder.setCounterMaxLength(13);
binding.billQRscan.setEnabled(true);
binding.billQRscan.setTextColor(getResources().getColor(R.color.gray));
break;
case 1:
viewModel.setType(BillInfo.BillType.GAS);
binding.billIdHolder.setHint(getResources().getString(R.string.elecBill_main_billIDHint3));
binding.billIdHolder.setCounterMaxLength(12);
binding.billQRscan.setEnabled(false);
binding.billQRscan.setTextColor(getResources().getColor(R.color.gray_300));
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
binding.modeGroup.setOnCheckedChangeListener((group, checkedId) -> onModeChangeView(checkedId));
binding.billIdET.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
viewModel.getBillIDErrorEnable().set(false);
}
@Override
public void afterTextChanged(Editable s) {
}
});
viewModel.getGoToBillDetailFrag().observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean) {
viewModel.getProgressVisibility().set(View.GONE);
new HelperFragment(getFragmentManager(), ElectricityBillPayFrag.newInstance(viewModel.getType(), viewModel.getBillID().get(), null, false)).setReplace(false).load();
}
});
}
Aggregations