use of net.iGap.module.customView.RecyclerListView in project iGap-Android by KianIranian-STDG.
the class MyStatusStoryListFragment 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);
Toolbar myStoryToolbar = new Toolbar(getContext());
myStoryToolbar.setTitle(getString(R.string.my_status));
myStoryToolbar.setBackIcon(new BackDrawable(false));
myStoryToolbar.setListener(i -> {
switch(i) {
case -1:
requireActivity().onBackPressed();
break;
}
});
FrameLayout rootView = new FrameLayout(new ContextThemeWrapper(context, R.style.IGapRootViewStyle));
rootView.addView(myStoryToolbar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP));
recyclerListView = new RecyclerListView(getContext());
adapter = new ListAdapter();
recyclerListView.setAdapter(adapter);
recyclerListView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
recyclerListView.setClipToPadding(false);
recyclerListView.setVisibility(View.GONE);
recyclerListView.setPadding(0, 0, 0, LayoutCreator.dp(30));
rootView.addView(recyclerListView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.TOP, 0, LayoutCreator.getDimen(R.dimen.toolbar_height), 0, 0));
progressBar = new ProgressBar(context);
progressBar.setVisibility(View.GONE);
rootView.addView(progressBar, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
actionButtonsRootView = new LinearLayout(context);
actionButtonsRootView.setOrientation(LinearLayout.VERTICAL);
rootView.addView(actionButtonsRootView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, (isAppRtl ? Gravity.LEFT : Gravity.RIGHT) | Gravity.BOTTOM, 16, 0, 16, 16));
customStatusActionLayout = new FrameLayout(context);
Drawable customStatusDrawable = Theme.createSimpleSelectorCircleDrawable(LayoutCreator.dp(56), Theme.getInstance().getToolbarBackgroundColor(context), Theme.getInstance().getAccentColor(context));
customStatusActionLayout.setBackground(customStatusDrawable);
IconView customStatusAddButton = new IconView(context);
customStatusAddButton.setIcon(R.string.icon_edit);
customStatusAddButton.setIconColor(Color.WHITE);
customStatusActionLayout.addView(customStatusAddButton);
actionButtonsRootView.addView(customStatusActionLayout, LayoutCreator.createLinear(42, 42, Gravity.CENTER, 0, 0, 0, 0));
floatActionLayout = new FrameLayout(context);
Drawable drawable = Theme.createSimpleSelectorCircleDrawable(LayoutCreator.dp(56), Theme.getInstance().getToolbarBackgroundColor(context), Theme.getInstance().getAccentColor(context));
floatActionLayout.setBackground(drawable);
IconView addButton = new IconView(context);
addButton.setIcon(R.string.icon_camera);
addButton.setIconColor(Color.WHITE);
floatActionLayout.addView(addButton);
actionButtonsRootView.addView(floatActionLayout, LayoutCreator.createLinear(52, 52, Gravity.CENTER, 0, 10, 0, 0));
return rootView;
}
use of net.iGap.module.customView.RecyclerListView in project iGap-Android by KianIranian-STDG.
the class StoryFragment 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);
Toolbar storyToolbar = new Toolbar(getContext());
storyToolbar.setTitle(isAppRtl ? R.string.logo_igap_fa : R.string.logo_igap_en);
ToolbarItems toolbarItems = storyToolbar.createToolbarItems();
toolbarItems.addItemWithWidth(codeScannerTag, R.string.icon_QR_code, 54);
storyToolbar.setListener(i -> {
switch(i) {
case codeScannerTag:
onCodeScannerClickListener();
break;
}
});
FrameLayout rootView = new FrameLayout(new ContextThemeWrapper(context, R.style.IGapRootViewStyle));
rootView.addView(storyToolbar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP));
swipeRefreshLayout = new SwipeRefreshLayout(context);
swipeRefreshLayout.setRefreshing(false);
rootView.addView(swipeRefreshLayout, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.TOP, 0, LayoutCreator.getDimen(R.dimen.toolbar_height), 0, 0));
recyclerListView = new RecyclerListView(getContext());
adapter = new ListAdapter();
recyclerListView.setAdapter(adapter);
recyclerListView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
recyclerListView.setClipToPadding(false);
recyclerListView.setPadding(0, 0, 0, LayoutCreator.dp(30));
swipeRefreshLayout.addView(recyclerListView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER, 0, 0, 0, 0));
progressBar = new ProgressBar(context);
progressBar.setVisibility(View.GONE);
rootView.addView(progressBar, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
actionButtonsRootView = new LinearLayout(context);
actionButtonsRootView.setOrientation(LinearLayout.VERTICAL);
rootView.addView(actionButtonsRootView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, (isAppRtl ? Gravity.LEFT : Gravity.RIGHT) | Gravity.BOTTOM, 16, 0, 16, 16));
customStatusActionLayout = new FrameLayout(context);
Drawable customStatusDrawable = Theme.createSimpleSelectorCircleDrawable(LayoutCreator.dp(56), Theme.getInstance().getToolbarBackgroundColor(context), Theme.getInstance().getAccentColor(context));
customStatusActionLayout.setBackground(customStatusDrawable);
IconView customStatusAddButton = new IconView(context);
customStatusAddButton.setIcon(R.string.icon_edit);
customStatusAddButton.setIconColor(Color.WHITE);
customStatusActionLayout.addView(customStatusAddButton);
actionButtonsRootView.addView(customStatusActionLayout, LayoutCreator.createLinear(42, 42, Gravity.CENTER, 0, 0, 0, 0));
floatActionLayout = new FrameLayout(context);
Drawable drawable = Theme.createSimpleSelectorCircleDrawable(LayoutCreator.dp(56), Theme.getInstance().getToolbarBackgroundColor(context), Theme.getInstance().getAccentColor(context));
floatActionLayout.setBackground(drawable);
IconView addButton = new IconView(context);
addButton.setIcon(R.string.icon_camera);
addButton.setIconColor(Color.WHITE);
floatActionLayout.addView(addButton);
actionButtonsRootView.addView(floatActionLayout, LayoutCreator.createLinear(52, 52, Gravity.CENTER, 0, 10, 0, 0));
return rootView;
}
use of net.iGap.module.customView.RecyclerListView 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.module.customView.RecyclerListView in project iGap-Android by KianIranian-STDG.
the class ChatRightsFragment 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 = currentMode == 0 || currentMode == 1 ? getResources().getString(R.string.admin_rights) : isRoom() ? getResources().getString(R.string.edit_room_rights) : getResources().getString(R.string.edit_member_rights);
View toolBar = helperToolbar.setContext(getContext()).setLogoShown(true).setListener(this).setRightIcons(R.string.icon_check_ok).setLeftIcon(R.string.icon_back).setDefaultTitle(getString(R.string.new_channel)).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));
progressView = new ProgressBar(getContext());
progressView.setVisibility(View.GONE);
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));
rootView.addView(progressView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
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.module.customView.RecyclerListView in project iGap-Android by KianIranian-STDG.
the class BottomSheetStory method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FrameLayout frameLayout = new FrameLayout(getContext());
lineView = new View(getContext());
lineView.setBackgroundColor(Color.GRAY);
lineView.setBackground(getContext().getResources().getDrawable(R.drawable.bottom_sheet_dialog_line_dark));
frameLayout.addView(lineView, LayoutCreator.createFrame(30, 3, Gravity.TOP | Gravity.CENTER_HORIZONTAL, padding, padding, padding, padding));
textView = new TextView(getContext());
textView.setText("Nazanin_Omrani");
textView.setTextColor(Color.BLACK);
textView.setTypeface(ResourcesCompat.getFont(getContext(), R.font.main_font_bold));
frameLayout.addView(textView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, padding, padding * 2, padding, padding));
lineView2 = new View(getContext());
lineView2.setBackgroundColor(Color.GRAY);
frameLayout.addView(lineView2, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 1, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, padding * 4, 0, padding));
listView = new RecyclerListView(getContext());
listView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
listView.setAdapter(adapter = new Adapter());
frameLayout.addView(listView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP, padding, padding * 4, padding, padding));
adapter.setRow();
return frameLayout;
}
Aggregations