Search in sources :

Example 1 with RecyclerListView

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;
}
Also used : IconView(net.iGap.messenger.ui.components.IconView) ContextThemeWrapper(android.view.ContextThemeWrapper) FrameLayout(android.widget.FrameLayout) Drawable(android.graphics.drawable.Drawable) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) Nullable(androidx.annotation.Nullable)

Example 2 with RecyclerListView

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;
}
Also used : IconView(net.iGap.messenger.ui.components.IconView) ContextThemeWrapper(android.view.ContextThemeWrapper) FrameLayout(android.widget.FrameLayout) ToolbarItems(net.iGap.messenger.ui.toolBar.ToolbarItems) Drawable(android.graphics.drawable.Drawable) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) SwipeRefreshLayout(androidx.swiperefreshlayout.widget.SwipeRefreshLayout) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) Nullable(androidx.annotation.Nullable)

Example 3 with RecyclerListView

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;
}
Also used : FrameLayout(android.widget.FrameLayout) HelperToolbar(net.iGap.helper.HelperToolbar) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) RecyclerListView(net.iGap.module.customView.RecyclerListView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Nullable(androidx.annotation.Nullable)

Example 4 with RecyclerListView

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;
}
Also used : FrameLayout(android.widget.FrameLayout) HelperToolbar(net.iGap.helper.HelperToolbar) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) RecyclerListView(net.iGap.module.customView.RecyclerListView) ProgressBar(android.widget.ProgressBar) Nullable(androidx.annotation.Nullable)

Example 5 with RecyclerListView

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;
}
Also used : FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) RecyclerListView(net.iGap.module.customView.RecyclerListView) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Nullable(androidx.annotation.Nullable)

Aggregations

FrameLayout (android.widget.FrameLayout)6 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)6 RecyclerListView (net.iGap.module.customView.RecyclerListView)6 Nullable (androidx.annotation.Nullable)5 View (android.view.View)3 ProgressBar (android.widget.ProgressBar)3 RecyclerView (androidx.recyclerview.widget.RecyclerView)3 Drawable (android.graphics.drawable.Drawable)2 ContextThemeWrapper (android.view.ContextThemeWrapper)2 LinearLayout (android.widget.LinearLayout)2 HelperToolbar (net.iGap.helper.HelperToolbar)2 IconView (net.iGap.messenger.ui.components.IconView)2 Toolbar (net.iGap.messenger.ui.toolBar.Toolbar)2 TextView (android.widget.TextView)1 SwipeRefreshLayout (androidx.swiperefreshlayout.widget.SwipeRefreshLayout)1 BackDrawable (net.iGap.messenger.ui.toolBar.BackDrawable)1 ToolbarItems (net.iGap.messenger.ui.toolBar.ToolbarItems)1