android.widget.HorizontalScrollView Java Examples
The following examples show how to use
android.widget.HorizontalScrollView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilterSelectorFragment.java From PixaToon with GNU General Public License v3.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_filterselector, container, false); mFilterMap = new HashMap<>(); initFilterMap(); for(int filterBtnId : mFilterMap.keySet()) { View filterSelectBtn = view.findViewById(filterBtnId); filterSelectBtn.setOnClickListener(this); if(((MainActivity)getActivity()).getOrientation() == Configuration.ORIENTATION_LANDSCAPE) filterSelectBtn.setRotation(90); } mScrollBar = (HorizontalScrollView)view.findViewById(R.id.scrollBar); return view; }
Example #2
Source File: WallpaperPickerActivity.java From TurboLauncher with Apache License 2.0 | 6 votes |
private void initializeScrollForRtl() { final HorizontalScrollView scroll = (HorizontalScrollView) findViewById(R.id.wallpaper_scroll_container); if (scroll.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { final ViewTreeObserver observer = scroll.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { public void onGlobalLayout() { LinearLayout masterWallpaperList = (LinearLayout) findViewById(R.id.master_wallpaper_list); scroll.scrollTo(masterWallpaperList.getWidth(), 0); scroll.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); } }
Example #3
Source File: MarkwonLinearLayoutManager.java From Infinity-For-Reddit with GNU Affero General Public License v3.0 | 6 votes |
@Override public void addView(View child) { super.addView(child); if (child instanceof HorizontalScrollView) { child.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { private int x = 0; @Override public void onScrollChanged() { if (child.getScrollX() < x) { horizontalScrollViewScrolledListener.onScrolledLeft(); } else { horizontalScrollViewScrolledListener.onScrolledRight(); } x = child.getScrollX(); } }); } }
Example #4
Source File: LuBottomMenu.java From RichEditorView with Apache License 2.0 | 6 votes |
private void removeAllLevels(int num) { if (num >= mDisplayRowNum || num < 1) { return; } int b = mDisplayRowNum - num; for (int i = mDisplayRowNum - 1; i >= b; i--) { if (mDisplayMenus.get(i).getChildAt(0) instanceof HorizontalScrollView) { View v = ((HorizontalScrollView) mDisplayMenus.get(i).getChildAt(0)).getChildAt(0); if (v != null && v instanceof LinearLayout) { ((LinearLayout) v).removeAllViews(); } } mDisplayMenus.get(i).removeAllViews(); mDisplayMenus.remove(i); removeView(getChildAt(i)); getBottomMenuItem(mPathRecord.peek()).setSelected(false); mPathRecord.pop(); mDisplayRowNum--; } }
Example #5
Source File: CaptureType.java From ViewCapture with Apache License 2.0 | 6 votes |
void of(T t) { Capture capture; if (t instanceof RecyclerView) { capture = new RecyclerViewCapture(); } else if (t instanceof ListView) { capture = new ListViewCapture(); } else if (t instanceof ScrollView) { capture = new ScrollViewCapture(); } else if (t instanceof HorizontalScrollView) { capture = new HorizontalScrollViewCapture(); } else if (t instanceof WebView) { capture = new WebViewCapture(); } else if (t instanceof Activity) { capture = new WindowCapture(); } else { capture = new DefaultViewCapture(); } captureManager.into(t, capture); }
Example #6
Source File: AndroidUtilities.java From Telegram with GNU General Public License v2.0 | 6 votes |
public static void setScrollViewEdgeEffectColor(HorizontalScrollView scrollView, int color) { if (Build.VERSION.SDK_INT >= 21) { try { Field field = HorizontalScrollView.class.getDeclaredField("mEdgeGlowLeft"); field.setAccessible(true); EdgeEffect mEdgeGlowTop = (EdgeEffect) field.get(scrollView); if (mEdgeGlowTop != null) { mEdgeGlowTop.setColor(color); } field = HorizontalScrollView.class.getDeclaredField("mEdgeGlowRight"); field.setAccessible(true); EdgeEffect mEdgeGlowBottom = (EdgeEffect) field.get(scrollView); if (mEdgeGlowBottom != null) { mEdgeGlowBottom.setColor(color); } } catch (Exception e) { FileLog.e(e); } } }
Example #7
Source File: KeyboardFragment.java From AndroidMathKeyboard with Apache License 2.0 | 6 votes |
/** * 键盘左侧菜单 */ private void menuKeyboard(Dialog dialog) { evLatexView = (EditView) dialog.findViewById(R.id.evLatexView); hsvLatex = (HorizontalScrollView) dialog.findViewById(R.id.hsvLatex); tvConfirm = (TextView) dialog.findViewById(R.id.tvConfirm); llMathKeyBoardLayout = (LinearLayout) dialog.findViewById(R.id.llMathKeyBoardLayout); llLatterKeyBoardLayout = (LinearLayout) dialog.findViewById(R.id.llLatterKeyBoardLayout); llDefaultLayout = (LinearLayout) dialog.findViewById(R.id.llDefaultLayout); tlAlgebraLayout = (LinearLayout) dialog.findViewById(R.id.tlAlgebraLayout); llGeometryLayout = (LinearLayout) dialog.findViewById(R.id.llGeometryLayout); tvDefault = (TextView) dialog.findViewById(R.id.tvDefault); tvAlgebra = (TextView) dialog.findViewById(R.id.tvAlgebra); tvGeometry = (TextView) dialog.findViewById(R.id.tvGeometry); tvLetter = (TextView) dialog.findViewById(R.id.tvLetter); tvConfirm.setOnClickListener(onClickListener); tvDefault.setOnClickListener(onClickListener); tvAlgebra.setOnClickListener(onClickListener); tvGeometry.setOnClickListener(onClickListener); tvLetter.setOnClickListener(onClickListener); }
Example #8
Source File: ReactHorizontalScrollViewTestCase.java From react-native-GPay with MIT License | 6 votes |
public void testScrollEvents() { HorizontalScrollView scrollView = getViewAtPath(0); dragLeft(); waitForBridgeAndUIIdle(); mScrollListenerModule.waitForScrollIdle(); waitForBridgeAndUIIdle(); ArrayList<Double> xOffsets = mScrollListenerModule.getXOffsets(); assertFalse("Expected to receive at least one scroll event", xOffsets.isEmpty()); assertTrue("Expected offset to be greater than 0", xOffsets.get(xOffsets.size() - 1) > 0); assertTrue( "Expected no item click event fired", mScrollListenerModule.getItemsPressed().isEmpty()); assertEquals( "Expected last offset to be offset of scroll view", PixelUtil.toDIPFromPixel(scrollView.getScrollX()), xOffsets.get(xOffsets.size() - 1).doubleValue(), 1e-5); }
Example #9
Source File: EditPage.java From BigApp_WordPress_Android with Apache License 2.0 | 6 votes |
private void initImageListView() { final HorizontalScrollView hScrollView = (HorizontalScrollView) findViewByResName("hScrollView"); ImageListResultsCallback callback = new ImageListResultsCallback() { @Override public void onFinish(ArrayList<ImageInfo> results) { if(results == null) return; LinearLayout layout = (LinearLayout) findViewByResName("imagesLinearLayout"); for(ImageInfo imageInfo : results) { if(imageInfo.bitmap == null) continue; layout.addView(makeImageItemView(imageInfo)); } } }; if(!initImageList(callback)) { hScrollView.setVisibility(View.GONE); } }
Example #10
Source File: HorizontalScrollCompat.java From SmoothRefreshLayout with MIT License | 6 votes |
public static boolean isScrollingView(View view) { if (ViewCatcherUtil.isViewPager(view) || view instanceof HorizontalScrollView || view instanceof WebView) { return true; } else if (ViewCatcherUtil.isRecyclerView(view)) { RecyclerView recyclerView = (RecyclerView) view; RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); if (manager != null) { if (manager instanceof LinearLayoutManager) { LinearLayoutManager linearManager = ((LinearLayoutManager) manager); return linearManager.getOrientation() == RecyclerView.HORIZONTAL; } else if (manager instanceof StaggeredGridLayoutManager) { StaggeredGridLayoutManager gridLayoutManager = (StaggeredGridLayoutManager) manager; return gridLayoutManager.getOrientation() == RecyclerView.HORIZONTAL; } } } return false; }
Example #11
Source File: HollyViewPager.java From HollyViewPager with Apache License 2.0 | 6 votes |
@Override protected void onFinishInflate() { super.onFinishInflate(); addView(LayoutInflater.from(getContext()).inflate(R.layout.holly_view_pager, this, false)); viewPager = (ViewPager) findViewById(R.id.bfp_viewPager); headerScroll = (HorizontalScrollView) findViewById(R.id.bfp_headerScroll); headerLayout = (ViewGroup) findViewById(R.id.bfp_headerLayout); { ViewGroup.LayoutParams layoutParams = headerLayout.getLayoutParams(); layoutParams.height = this.settings.headerHeightPx; headerLayout.setLayoutParams(layoutParams); } animator = new HollyViewPagerAnimator(this); }
Example #12
Source File: WallpaperPickerActivity.java From LB-Launcher with Apache License 2.0 | 6 votes |
private void initializeScrollForRtl() { final HorizontalScrollView scroll = (HorizontalScrollView) findViewById(R.id.wallpaper_scroll_container); if (scroll.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { final ViewTreeObserver observer = scroll.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { public void onGlobalLayout() { LinearLayout masterWallpaperList = (LinearLayout) findViewById(R.id.master_wallpaper_list); scroll.scrollTo(masterWallpaperList.getWidth(), 0); scroll.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); } }
Example #13
Source File: TableFragment.java From android_dbinspector with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.dbinspector_fragment_table, container, false); tableLayout = (TableLayout) view.findViewById(R.id.dbinspector_table_layout); previousButton = view.findViewById(R.id.dbinspector_button_previous); nextButton = view.findViewById(R.id.dbinspector_button_next); currentPageText = (TextView) view.findViewById(R.id.dbinspector_text_current_page); contentHeader = view.findViewById(R.id.dbinspector_layout_content_header); scrollView = (ScrollView) view.findViewById(R.id.dbinspector_scrollview_table); horizontalScrollView = (HorizontalScrollView) view.findViewById(R.id.dbinspector_horizontal_scrollview_table); previousButton.setOnClickListener(previousListener); nextButton.setOnClickListener(nextListener); return view; }
Example #14
Source File: EditPage.java From BigApp_Discuz_Android with Apache License 2.0 | 6 votes |
private void initImageListView() { final HorizontalScrollView hScrollView = (HorizontalScrollView) findViewByResName("hScrollView"); ImageListResultsCallback callback = new ImageListResultsCallback() { @Override public void onFinish(ArrayList<ImageInfo> results) { if(results == null) return; LinearLayout layout = (LinearLayout) findViewByResName("imagesLinearLayout"); for(ImageInfo imageInfo : results) { if(imageInfo.bitmap == null) continue; layout.addView(makeImageItemView(imageInfo)); } } }; if(!initImageList(callback)) { hScrollView.setVisibility(View.GONE); } }
Example #15
Source File: BodyElementTable.java From RedReader with GNU General Public License v3.0 | 5 votes |
@Override public View generateView( @NonNull final AppCompatActivity activity, @Nullable final Integer textColor, @Nullable final Float textSize, final boolean showLinkButtons) { final TableLayout table = new TableLayout(activity); for(final BodyElement element : mElements) { final View view = element.generateView(activity, textColor, textSize, showLinkButtons); table.addView(view); } table.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); table.setDividerDrawable(new ColorDrawable(Color.GRAY)); table.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); final HorizontalScrollView scrollView = new HorizontalScrollView(activity); scrollView.addView(table); return scrollView; }
Example #16
Source File: VertActivity.java From AdvancedTextView with Apache License 2.0 | 5 votes |
private void init() { scroll_rtl = (HorizontalScrollView) findViewById(R.id.scroll_rtl); vtv_text_ltr = (VerticalTextView) findViewById(R.id.vtv_text_ltr); vtv_text_ltr.setText(Html.fromHtml(StringContentUtil.str_cbf).toString()); vtv_text_ltr.setLeftToRight(true) .setLineSpacingExtra(10) .setCharSpacingExtra(2) .setUnderLineText(true) .setShowActionMenu(true) .setUnderLineColor(0xffCEAD53) .setUnderLineWidth(1.0f) .setUnderLineOffset(3) .setTextHighlightColor(0xffCEAD53) .setCustomActionMenuCallBack(this); vtv_text_ltr.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(VertActivity.this, "onClick事件", Toast.LENGTH_SHORT).show(); } }); rg_text_orient = findViewById(R.id.rg_text_orient); rg_text_underline = findViewById(R.id.rg_text_underline); rg_text_orient.setOnCheckedChangeListener(this); rg_text_underline.setOnCheckedChangeListener(this); }
Example #17
Source File: HBARScrollActivity.java From XCL-Charts with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hbarscroll); this.setTitle("柱形图左右滑动"); horiView = (HorizontalScrollView) findViewById(R.id.horizontalScrollView1); horiView.setPadding(70, 0, 0, 0); //设置horizontalScrollvView拉到头和尾的时候没有阴影颜色 horiView.setOverScrollMode(View.OVER_SCROLL_NEVER); }
Example #18
Source File: DisplayModelActivity.java From nosey with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; textSize = (int) getResources().getDimension(R.dimen.cell_text_size); padding = (int) getResources().getDimension(R.dimen.cell_padding); Nosey nosey = Nosey.getInstance(this); Inspector.ModelMapInspector inspector = new Inspector.ModelMapInspector(); inspector.inspect(nosey); String modelKey = getIntent().getStringExtra(EXTRA_MODEL_KEY); model = inspector.getModelMap().get(modelKey); methods = model.getDeclaredMethods(); Arrays.sort(methods, new MemberComparator<Method>()); TableLayout table = new TableLayout(this); addModelFieldHeaders(table, inspector); addModelDataRows(table, inspector); ScrollView scrollView = new ScrollView(this); scrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); scrollView.setHorizontalScrollBarEnabled(true); scrollView.setVerticalScrollBarEnabled(true); scrollView.setFillViewport(true); HorizontalScrollView horizontalScrollView = new HorizontalScrollView(this); horizontalScrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); horizontalScrollView.setHorizontalScrollBarEnabled(true); horizontalScrollView.setVerticalScrollBarEnabled(true); horizontalScrollView.setFillViewport(true); scrollView.addView(horizontalScrollView); horizontalScrollView.addView(table); setContentView(scrollView); }
Example #19
Source File: DetailFragment.java From WeCenterMobile-Android with GNU General Public License v2.0 | 5 votes |
@SuppressLint("NewApi") @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView ; dp = getActivity().getResources().getDimension(R.dimen.dp); rootView = inflater.inflate(R.layout.asking_bg, container, false); editText = (EditText)rootView.findViewById(R.id.quesdet); selectimg_horizontalScrollView = (HorizontalScrollView)rootView.findViewById(R.id.selectimg_horizontalScrollView); gridview = (GridView) rootView.findViewById(R.id.noScrollgridview); gridview.setSelector(new ColorDrawable(Color.TRANSPARENT)); gridviewInit(); return rootView; }
Example #20
Source File: CodeAreaFragment.java From APDE with GNU General Public License v2.0 | 5 votes |
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); code = (CodeEditText) getView().findViewById(R.id.code); codeScroller = (ScrollView) getView().findViewById(R.id.code_scroller); codeScrollerX = (HorizontalScrollView) getView().findViewById(R.id.code_scroller_x); code.setSketchFile(sketchFile); getGlobalState().writeCodeDeletionDebugStatus("fragment onActivityCreated()"); }
Example #21
Source File: AccessibilityUtil.java From stetho with MIT License | 5 votes |
/** * Determines whether the provided {@link View} and {@link AccessibilityNodeInfoCompat} is a * top-level item in a scrollable container. * * @param view The {@link View} to evaluate * @param node The {@link AccessibilityNodeInfoCompat} to evaluate * @return {@code true} if it is a top-level item in a scrollable container. */ public static boolean isTopLevelScrollItem( @Nullable AccessibilityNodeInfoCompat node, @Nullable View view) { if (node == null || view == null) { return false; } View parent = (View) ViewCompat.getParentForAccessibility(view); if (parent == null) { return false; } if (node.isScrollable()) { return true; } List actionList = node.getActionList(); if (actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD) || actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD)) { return true; } // AdapterView, ScrollView, and HorizontalScrollView are focusable // containers, but Spinner is a special case. if (parent instanceof Spinner) { return false; } return parent instanceof AdapterView || parent instanceof ScrollView || parent instanceof HorizontalScrollView; }
Example #22
Source File: SubredditView.java From Slide with GNU General Public License v3.0 | 5 votes |
private void setViews(String rawHTML, String subreddit, SpoilerRobotoTextView firstTextView, CommentOverflow commentOverflow) { if (rawHTML.isEmpty()) { return; } List<String> blocks = SubmissionParser.getBlocks(rawHTML); int startIndex = 0; // the <div class="md"> case is when the body contains a table or code block first if (!blocks.get(0).equals("<div class=\"md\">")) { firstTextView.setVisibility(View.VISIBLE); firstTextView.setTextHtml(blocks.get(0), subreddit); startIndex = 1; } else { firstTextView.setText(""); firstTextView.setVisibility(View.GONE); } if (blocks.size() > 1) { if (startIndex == 0) { commentOverflow.setViews(blocks, subreddit); } else { commentOverflow.setViews(blocks.subList(startIndex, blocks.size()), subreddit); } SidebarLayout sidebar = (SidebarLayout) findViewById(R.id.drawer_layout); for (int i = 0; i < commentOverflow.getChildCount(); i++) { View maybeScrollable = commentOverflow.getChildAt(i); if (maybeScrollable instanceof HorizontalScrollView) { sidebar.addScrollable(maybeScrollable); } } } else { commentOverflow.removeAllViews(); } }
Example #23
Source File: FootSearchView.java From letv with Apache License 2.0 | 5 votes |
protected void init(Context context) { this.mContext = context; this.footSearchView = UIsUtils.inflate(this.mContext, R.layout.home_bottom_search_words, null); this.footSearchAutoCompleteTextView = (TextView) this.footSearchView.findViewById(R.id.search_textview); this.footSearchBoxLayout = (RelativeLayout) this.footSearchView.findViewById(R.id.search_box_layout); this.footSearchHotWordsLayout = (LinearLayout) this.footSearchView.findViewById(R.id.linearlayout_search_words); this.footSearchHotWordsRootView = (LinearLayout) this.footSearchView.findViewById(R.id.search_words_root); this.footSearchScrollView = (HorizontalScrollView) this.footSearchView.findViewById(R.id.horizontal_scroll_view); this.footSearchHotWordSpace = getResources().getDimensionPixelSize(2131165547); this.footSearchBoxLayout.setOnClickListener(this.searchBoxClickListener); LayoutParams layoutParams = new LayoutParams(-1, -2); layoutParams.topMargin = UIsUtils.zoomWidth(12); this.footSearchView.setLayoutParams(layoutParams); addView(this.footSearchView); }
Example #24
Source File: ClickableTextIndicator.java From AndroidUiKit with Apache License 2.0 | 5 votes |
private void addRoutes(RouteEntity[] data) { if (data == null || data.length <= 0) { return; } changeLastOneColor(true); for (int i = 0; i < data.length; i++) { TextView textView = createTextView(); RouteEntity entity = data[i]; int size = routes.size(); String name = size <= 0 ? entity.routeName : " > ".concat(entity.routeName); if (i == data.length - 1) { textView.setText(name); } else { int start = i <= 0 ? 0 : 1; int end = name.length(); SpannableString spannableString = new SpannableString(name); spannableString.setSpan(new ForegroundColorSpan(TEXT_HIGHLIGHT_COLOR), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); textView.setText(spannableString); } textView.setTag(entity); this.routes.add(entity); contentView.addView(textView); } postDelayed(new Runnable() { @Override public void run() { fullScroll(HorizontalScrollView.FOCUS_RIGHT); } }, 200); if (routes != null && routes.size() > 0) { notifyOnChanged(routes.get(routes.size() - 1), null); } }
Example #25
Source File: AppBarHorizontalScrollingTest.java From material-components-android with Apache License 2.0 | 5 votes |
@Test public void testScrollAndClick() throws Throwable { final Activity activity = activityTestRule.getActivity(); final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation(); final Button button = activity.findViewById(R.id.button); final View.OnClickListener mockClickListener = mock(View.OnClickListener.class); button.setOnClickListener(mockClickListener); // Emulate a click on the button to verify that the registered listener is invoked // prior to performing a horizontal swipe across the app ba final int[] buttonXY = new int[2]; button.getLocationOnScreen(buttonXY); final int buttonWidth = button.getWidth(); final int buttonHeight = button.getHeight(); final float emulatedTapX = buttonXY[0] + buttonWidth / 2.0f; final float emulatedTapY = buttonXY[1] + buttonHeight / 2.0f; emulateButtonClick(instrumentation, emulatedTapX, emulatedTapY); verify(mockClickListener).onClick(button); reset(mockClickListener); final HorizontalScrollView hsv = activity.findViewById(R.id.hsv); final int scrollXBefore = hsv.getScrollX(); // Now scroll / swipe horizontally across our scrollable content in the app bar onView(withId(R.id.app_bar)).perform(swipeLeft()); assertTrue("Horizontal scroll performed", hsv.getScrollX() > scrollXBefore); // And emulate another click on the button to verify that the registered listener is still // invoked immediately after performing the horizontal swipe across the app bar emulateButtonClick(instrumentation, emulatedTapX, emulatedTapY); verify(mockClickListener).onClick(button); }
Example #26
Source File: ScrollViewDemoFragment.java From elasticity with BSD 2-Clause "Simplified" License | 5 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View fragmentView = inflater.inflate(R.layout.scrollview_overscroll_demo, null, false); initHorizontalScrollView((HorizontalScrollView) fragmentView.findViewById(R.id.horizontal_scroll_view)); initVerticalScrollView((ScrollView) fragmentView.findViewById(R.id.vertical_scroll_view)); return fragmentView; }
Example #27
Source File: SelectFriendActivity.java From o2oa with GNU Affero General Public License v3.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_create_group); mView = (SelectFriendView) findViewById(R.id.select_friend_view); mGroupAdapter = new CreateGroupAdapter(SelectFriendActivity.this); scrollViewSelected = (HorizontalScrollView) findViewById(R.id.contact_select_area); imageSelectedGridView = (GridView) findViewById(R.id.contact_select_area_grid); imageSelectedGridView.setAdapter(mGroupAdapter); mView.initModule(mRatio, mDensity); mController = new SelectFriendController(mView, this, getIntent().getLongExtra("add_friend_group_id", 0), scrollViewSelected, mGroupAdapter, imageSelectedGridView); mView.setListeners(mController); mView.setSideBarTouchListener(mController); mView.setTextWatcher(mController); mView.setGoneSideBar(false); SoftKeyBoardStateHelper helper = new SoftKeyBoardStateHelper(findViewById(R.id.select_friend_view)); helper.addSoftKeyboardStateListener(new SoftKeyBoardStateHelper.SoftKeyboardStateListener() { @Override public void onSoftKeyboardOpened(int keyboardHeightInPx) { mView.setGoneSideBar(true); } @Override public void onSoftKeyboardClosed() { mView.setGoneSideBar(false); } }); }
Example #28
Source File: AllMembersAdapter.java From o2oa with GNU Affero General Public License v3.0 | 5 votes |
public AllMembersAdapter(MembersInChatActivity context, List<MembersInChatActivity.ItemModel> memberList, boolean isDeleteMode, boolean isCreator, long groupId, int width, HorizontalScrollView horizontalView, GridView imageSelectedGridView, CreateGroupAdapter groupAdapter) { this.mContext = context; this.mMemberList = memberList; this.mIsDeleteMode = isDeleteMode; this.mIsCreator = isCreator; this.mGroupId = groupId; this.mWidth = width; this.mGridView = imageSelectedGridView; this.mHorizontalScrollView = horizontalView; this.mGroupAdapter = groupAdapter; selectNum = (TextView) context.findViewById(R.id.tv_selNum); }
Example #29
Source File: MainActivity.java From android-apps with MIT License | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); autoScrollView = (HorizontalScrollView) findViewById(R.id.autoScrollView); ll_container = (LinearLayout) findViewById(R.id.ll_container); imageViewlarge = (ImageView) findViewById(R.id.imageViewlarge); }
Example #30
Source File: LiveThread.java From Slide with GNU General Public License v3.0 | 5 votes |
private void setViews(String rawHTML, String subreddit, SpoilerRobotoTextView firstTextView, CommentOverflow commentOverflow) { if (rawHTML.isEmpty()) { return; } List<String> blocks = SubmissionParser.getBlocks(rawHTML); int startIndex = 0; // the <div class="md"> case is when the body contains a table or code block first if (!blocks.get(0).equals("<div class=\"md\">")) { firstTextView.setVisibility(View.VISIBLE); firstTextView.setTextHtml(blocks.get(0), subreddit); startIndex = 1; } else { firstTextView.setText(""); firstTextView.setVisibility(View.GONE); } if (blocks.size() > 1) { if (startIndex == 0) { commentOverflow.setViews(blocks, subreddit); } else { commentOverflow.setViews(blocks.subList(startIndex, blocks.size()), subreddit); } SidebarLayout sidebar = (SidebarLayout) findViewById(R.id.drawer_layout); for (int i = 0; i < commentOverflow.getChildCount(); i++) { View maybeScrollable = commentOverflow.getChildAt(i); if (maybeScrollable instanceof HorizontalScrollView) { sidebar.addScrollable(maybeScrollable); } } } else { commentOverflow.removeAllViews(); } }