use of net.iGap.module.MaterialDesignTextView in project iGap-Android by KianIranian-STDG.
the class StatusTextFragment method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
rootView = new NotifyFrameLayout(context) {
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (event != null && event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
if (isKeyboardVisible() || isPopupShowing()) {
showPopUPView(-1);
return true;
}
return false;
}
return super.dispatchKeyEventPreIme(event);
}
};
rootView.setListener(this);
rootView.setClickable(true);
random_int = (int) Math.floor(Math.random() * ((colors.length - 1) + 1));
textLayoutRoot = new FrameLayout(context);
textLayoutRoot.setBackgroundColor(colorCode = colors[random_int]);
rootView.addView(textLayoutRoot, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER));
addTextRootView = new FrameLayout(getContext());
stickerBorder = new FrameLayout(getContext());
stickerBorder.setPadding(10, 10, 10, 10);
addTextRootView.addView(stickerBorder, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER, 8, 8, 8, 8));
textTv = new TextView(getContext());
textTv.setId(R.id.story_added_text);
textTv.setTextColor(Color.WHITE);
textTv.setGravity(Gravity.CENTER);
textTv.setTypeface(ResourcesCompat.getFont(getContext(), R.font.main_font_bold));
textTv.setTextSize(30);
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(textTv, 22, 30, 1, TypedValue.COMPLEX_UNIT_DIP);
stickerBorder.addView(textTv, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER, 14, 14, 14, 14));
textLayoutRoot.addView(addTextRootView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
addTextEditTExt = new EventEditText(context);
addTextEditTExt.setGravity(Gravity.CENTER);
addTextEditTExt.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
addTextEditTExt.setBackground(null);
addTextEditTExt.setTextColor(Color.WHITE);
addTextEditTExt.setHint(getString(R.string.type_a_moment));
addTextEditTExt.setTextSize(editTextSize);
addTextEditTExt.setSingleLine(false);
addTextEditTExt.setTypeface(ResourcesCompat.getFont(getContext(), R.font.main_font_bold));
addTextEditTExt.setFilters(new InputFilter[] { new InputFilter.LengthFilter(501) });
addTextEditTExt.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
bottomPanelRootView = new LinearLayout(context);
bottomPanelRootView.setOrientation(LinearLayout.VERTICAL);
rootView.addView(bottomPanelRootView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER, 0, 0, 0, 0));
bottomPanelRootView.addView(addTextEditTExt, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, 0, 1F, Gravity.CENTER, 5, 0, 5, 0));
layoutRootView = new FrameLayout(context);
bottomPanelRootView.addView(layoutRootView, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER, 0, 0, 0, 8));
bottomLyoutPannel = new LinearLayout(context);
bottomLyoutPannel.setOrientation(LinearLayout.HORIZONTAL);
layoutRootView.addView(bottomLyoutPannel, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.MATCH_PARENT, Gravity.LEFT | Gravity.CENTER, 16, 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_send);
addButton.setIconColor(Color.WHITE);
floatActionLayout.setVisibility(View.GONE);
floatActionLayout.addView(addButton);
layoutRootView.addView(floatActionLayout, LayoutCreator.createFrame(52, 52, Gravity.RIGHT | Gravity.CENTER, 0, 0, 16, 0));
palletTextView = new MaterialDesignTextView(context);
palletTextView.setGravity(Gravity.CENTER);
palletTextView.setBackground(context.getResources().getDrawable(R.drawable.ic_palete));
palletTextView.setTextColor(context.getResources().getColor(R.color.whit_background));
palletTextView.setTypeface(ResourcesCompat.getFont(context, R.font.font_icons));
palletTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 32);
bottomLyoutPannel.addView(palletTextView, LayoutCreator.createLinear(32, 32, 0, 0, 0, 10));
emoji = new MaterialDesignTextView(context);
emoji.setGravity(Gravity.CENTER);
emoji.setText(R.string.icon_emoji_smile);
emoji.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 32);
emoji.setTypeface(ResourcesCompat.getFont(context, R.font.font_icons));
emoji.setTextColor(context.getResources().getColor(R.color.white));
bottomLyoutPannel.addView(emoji, LayoutCreator.createLinear(30, 30, 0, 0, 12, 10));
chatKeyBoardContainer = new FrameLayout(context);
bottomPanelRootView.addView(chatKeyBoardContainer, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
return rootView;
}
use of net.iGap.module.MaterialDesignTextView in project iGap-Android by KianIranian-STDG.
the class FragmentIgapSearch method initComponent.
private void initComponent(View view) {
// view.findViewById(R.id.sfl_ll_toolbar).setBackgroundColor(Color.parseColor(G.appBarColor));
imvNothingFound = view.findViewById(R.id.sfl_imv_nothing_found);
imvNothingFound.setImageResource(R.drawable.find1);
txtEmptyListComment = view.findViewById(R.id.sfl_txt_empty_list_comment);
// txtNothing = (TextView) view.findViewById(R.id.sfl_txt_empty_nothing);
// txtNothing.setVisibility(View.VISIBLE);
G.handler.postDelayed(new Runnable() {
@Override
public void run() {
imvNothingFound.setVisibility(View.VISIBLE);
txtEmptyListComment.setVisibility(View.VISIBLE);
}
}, 150);
loadingProgressBar = view.findViewById(R.id.sfl_progress_loading);
loadingProgressBar.getIndeterminateDrawable().setColorFilter(new Theme().getAccentColor(getContext()), PorterDuff.Mode.SRC_IN);
// edtSearch = view.findViewById(R.id.sfl_edt_search);
edtSearch.setInputType(InputType.TYPE_CLASS_TEXT);
// edtSearch.setFilters(new InputFilter[] {
// new InputFilter() {
// public CharSequence filter(CharSequence src, int start, int end, Spanned dst, int dstart, int dend) {
//
// Log.e("qqqqqq", src + " " + start + " " + end + " " + dst + " " + dstart + " " + dend);
//
// if (src.equals("") || (dst.length() == 0 && src.equals("@"))) {
// return src;
// }
// if (src.toString().matches("\\w")) {
// return src;
// }
// return "";
// }
// }
// });
edtSearch.setText("@");
edtSearch.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
int strSize = edtSearch.getText().toString().length();
// filter some character
if (strSize > 1) {
String _str = edtSearch.getText().toString().substring(strSize - 1);
if (!_str.matches("\\w")) {
edtSearch.setText(edtSearch.getText().subSequence(0, strSize - 1));
edtSearch.setSelection(edtSearch.getText().length());
}
}
if (strSize > 5) {
if (getRequestManager().isUserLogin()) {
if ((!edtSearch.getText().toString().equals(preventRepeatSearch))) {
itemAdapter.clear();
new RequestClientSearchUsername().clientSearchUsername(edtSearch.getText().toString().substring(1));
loadingProgressBar.setVisibility(View.VISIBLE);
preventRepeatSearch = edtSearch.getText().toString();
}
} else {
HelperError.showSnackMessage(G.context.getString(R.string.there_is_no_connection_to_server), false);
}
}
}
@Override
public void afterTextChanged(Editable editable) {
if (edtSearch.getText().length() == 0 || !edtSearch.getText().toString().substring(0, 1).equals("@")) {
edtSearch.setText("@");
edtSearch.setSelection(1);
}
}
});
edtSearch.requestFocus();
InputMethodManager imm = (InputMethodManager) G.context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(edtSearch, InputMethodManager.SHOW_IMPLICIT);
/*
MaterialDesignTextView btnBack = (MaterialDesignTextView) view.findViewById(R.id.sfl_btn_back);
final RippleView rippleBack = (RippleView) view.findViewById(R.id.sfl_ripple_back);
rippleBack.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
@Override
public void onComplete(RippleView rippleView) {
InputMethodManager imm = (InputMethodManager) G.fragmentActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(rippleBack.getWindowToken(), 0);
//G.fragmentActivity.getSupportFragmentManager().beginTransaction().remove(FragmentIgapSearch.this).commit();
G.fragmentActivity.onBackPressed();
}
});
*/
// btnClose = (MaterialDesignTextView) view.findViewById(R.id.sfl_btn_close);
btnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edtSearch.setText("@");
edtSearch.setSelection(1);
}
});
// rippleDown = view.findViewById(R.id.sfl_ripple_done);
rippleDown.setEnabled(false);
rippleDown.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
@Override
public void onComplete(RippleView rippleView) {
}
});
recyclerView = view.findViewById(R.id.sfl_recycleview);
}
use of net.iGap.module.MaterialDesignTextView in project iGap-Android by KianIranian-STDG.
the class ViewMaker method getViewItemCall.
// *******************************************************************************************
public static View getViewItemCall(Context context) {
LinearLayout linearLayout_205 = new LinearLayout(context);
linearLayout_205.setId(R.id.mainContainer);
LinearLayout.LayoutParams layout_218 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
linearLayout_205.setLayoutParams(layout_218);
TypedValue rippleView = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, rippleView, true);
linearLayout_205.setBackgroundResource(rippleView.resourceId);
FrameLayout avatarContainer = new FrameLayout(context);
avatarContainer.setId(R.id.avatarContainer);
linearLayout_205.addView(avatarContainer, LayoutCreator.createLinear(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, CENTER, 10, 0, 10, 0));
CheckBox checkBox = new CheckBox(context);
checkBox.setId(R.id.fcsl_check_box);
checkBox.setVisibility(View.VISIBLE);
checkBox.setClickable(false);
CircleImageView fcsl_imv_picture = new CircleImageView(context);
fcsl_imv_picture.setId(R.id.fcsl_imv_picture);
avatarContainer.addView(fcsl_imv_picture, LayoutCreator.createFrame(48, 48, CENTER));
avatarContainer.addView(checkBox, LayoutCreator.createFrame(20, 20, Gravity.BOTTOM | END));
LinearLayout linearLayout_71 = new LinearLayout(context);
linearLayout_71.setOrientation(VERTICAL);
LinearLayout.LayoutParams layout_794 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, i_Dp(R.dimen.dp68));
linearLayout_71.setLayoutParams(layout_794);
LinearLayout linearLayout_470 = new LinearLayout(context);
linearLayout_470.setOrientation(HORIZONTAL);
LinearLayout.LayoutParams layout_822 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1);
linearLayout_470.setPadding(0, i_Dp(R.dimen.dp12), 0, 0);
linearLayout_470.setLayoutParams(layout_822);
LinearLayout linearLayout_983 = new LinearLayout(context);
linearLayout_983.setOrientation(VERTICAL);
LinearLayout.LayoutParams layout_313 = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 1);
layout_313.leftMargin = i_Dp(R.dimen.dp6);
linearLayout_983.setLayoutParams(layout_313);
AppCompatTextView fcsl_txt_name = new AppCompatTextView(context);
fcsl_txt_name.setId(R.id.fcsl_txt_name);
fcsl_txt_name.setPadding(0, 0, 0, dpToPixel(1));
fcsl_txt_name.setText("Name");
fcsl_txt_name.setSingleLine(true);
fcsl_txt_name.setTextColor(Theme.getInstance().getTitleTextColor(context));
setTextSize(fcsl_txt_name, R.dimen.standardTextSize);
fcsl_txt_name.setTypeface(ResourcesCompat.getFont(fcsl_txt_name.getContext(), R.font.main_font));
LinearLayout.LayoutParams layout_415 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layout_415.gravity = Gravity.START;
fcsl_txt_name.setLayoutParams(layout_415);
linearLayout_983.addView(fcsl_txt_name);
LinearLayout linearLayout_976 = new LinearLayout(G.context);
linearLayout_976.setOrientation(HORIZONTAL);
LinearLayout.LayoutParams layout_106 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
linearLayout_976.setLayoutParams(layout_106);
AppCompatTextView fcsl_txt_time_info = new AppCompatTextView(G.context);
fcsl_txt_time_info.setId(R.id.fcsl_txt_time_info);
fcsl_txt_time_info.setGravity(Gravity.START);
fcsl_txt_time_info.setSingleLine(true);
fcsl_txt_time_info.setText("(4) 9:24 am");
fcsl_txt_time_info.setTextColor(Theme.getInstance().getSubTitleColor(context));
setTextSize(fcsl_txt_time_info, R.dimen.smallTextSize);
fcsl_txt_time_info.setTypeface(ResourcesCompat.getFont(fcsl_txt_time_info.getContext(), R.font.main_font));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
fcsl_txt_time_info.setTextDirection(View.TEXT_DIRECTION_LOCALE);
}
LinearLayout.LayoutParams layout_959 = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1);
fcsl_txt_time_info.setLayoutParams(layout_959);
linearLayout_976.addView(fcsl_txt_time_info);
linearLayout_983.addView(linearLayout_976);
linearLayout_470.addView(linearLayout_983);
LinearLayout linearLayout_202 = new LinearLayout(context);
linearLayout_202.setOrientation(VERTICAL);
LinearLayout.LayoutParams layout_803 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
layout_803.rightMargin = i_Dp(R.dimen.dp8);
layout_803.leftMargin = i_Dp(R.dimen.dp8);
linearLayout_202.setLayoutParams(layout_803);
MaterialDesignTextView fcsl_txt_icon = new MaterialDesignTextView(context);
fcsl_txt_icon.setId(R.id.fcsl_txt_icon);
fcsl_txt_icon.setText(R.string.icon_single_contact);
fcsl_txt_icon.setTextColor(ContextCompat.getColor(context, R.color.green));
setTextSize(fcsl_txt_icon, R.dimen.dp18);
LinearLayout.LayoutParams layout_178 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layout_178.gravity = Gravity.END;
fcsl_txt_icon.setLayoutParams(layout_178);
linearLayout_202.addView(fcsl_txt_icon);
AppCompatTextView fcsl_txt_dureation_time = new AppCompatTextView(context);
fcsl_txt_dureation_time.setId(R.id.fcsl_txt_dureation_time);
fcsl_txt_dureation_time.setText("2:24");
fcsl_txt_dureation_time.setTextColor(ContextCompat.getColor(context, R.color.btn_start_page5));
setTextSize(fcsl_txt_dureation_time, R.dimen.dp12);
fcsl_txt_dureation_time.setTypeface(ResourcesCompat.getFont(fcsl_txt_dureation_time.getContext(), R.font.main_font));
LinearLayout.LayoutParams layout_483 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
fcsl_txt_dureation_time.setLayoutParams(layout_483);
linearLayout_202.addView(fcsl_txt_dureation_time);
linearLayout_470.addView(linearLayout_202);
linearLayout_71.addView(linearLayout_470);
View textView_316 = new View(context);
textView_316.setBackgroundColor(G.context.getResources().getColor(R.color.gray_3c));
LinearLayout.LayoutParams layout_241 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);
textView_316.setLayoutParams(layout_241);
linearLayout_71.addView(textView_316);
linearLayout_205.addView(linearLayout_71);
return linearLayout_205;
}
Aggregations