Java Code Examples for android.widget.LinearLayout.setVisibility()

The following are Jave code examples for showing how to use setVisibility() of the android.widget.LinearLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GravityBox   File: ColorPickerPreference.java   View Source Code Vote up 7 votes
private void setPreviewColor() {
	if (mView == null) return;
	ImageView iView = new ImageView(getContext());
	LinearLayout widgetFrameView = ((LinearLayout)mView.findViewById(android.R.id.widget_frame));
	if (widgetFrameView == null) return;
	widgetFrameView.setVisibility(View.VISIBLE);
	widgetFrameView.setPadding(
		widgetFrameView.getPaddingLeft(),
		widgetFrameView.getPaddingTop(),
		(int)(mDensity * 8),
		widgetFrameView.getPaddingBottom()
	);
	// remove already create preview image
	int count = widgetFrameView.getChildCount();
	if (count > 0) {
		widgetFrameView.removeViews(0, count);
	}
	widgetFrameView.addView(iView);
	widgetFrameView.setMinimumWidth(0);
	iView.setBackground(new AlphaPatternDrawable((int)(5 * mDensity)));
	iView.setImageBitmap(getPreviewBitmap());
}
 
Example 2
Project: Wings2K16   File: FeedbackFragment.java   View Source Code Vote up 6 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final View v = inflater.inflate(R.layout.activity_feedback, container, false);

    ((MainActivity) getActivity()).setActionBarTitle("Your Experience");
    LinearLayout errorLayout = (LinearLayout)v.findViewById(R.id.error);
    LinearLayout contLayout = (LinearLayout)v.findViewById(R.id.content);
    if (!com.geca.wings.NetworkUtil.isNetworkConnected(getActivity())){

        errorLayout.setVisibility(View.VISIBLE);
        contLayout.setVisibility(View.GONE);
    }else {
        webView = (WebView) v.findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("http://goo.gl/forms/lKKl8xbKlz");
    }
    return v;
}
 
Example 3
Project: Kasumi   File: MainActivity.java   View Source Code Vote up 6 votes
public void changeFolder(long id) {
    KRFAM.log("MainActivity.java > changeFolder");
    CURRENT_FOLDER = id;
    KRFAM.sharedPreferences.edit().putLong("CURRENT_FOLDER", CURRENT_FOLDER).commit();
    CURRENT_OFFSET = 0;
    TextView currentFolder_textView = (TextView) findViewById(R.id.folder_currentFolder);
    TextView currentCount_textView = (TextView) findViewById(R.id.folder_currentCount);
    if (CURRENT_FOLDER == -1) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(false);
        findViewById(R.id.folder_currentWrapper).setVisibility(View.GONE);
    } else {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        findViewById(R.id.folder_currentWrapper).setVisibility(View.VISIBLE);
        currentFolder_textView.setText(getPathToFolder(CURRENT_FOLDER));
        currentFolder_textView.setSelected(true);
        currentCount_textView.setText("" + db.countAccounts(CURRENT_FOLDER, "", false));
    }
    LinearLayout searchBar = (LinearLayout) findViewById(R.id.view_search);
    searchBar.setVisibility(View.GONE);
    getCurrentPage();
}
 
Example 4
Project: aftercare-app-android   File: DCResetPasswordFragment.java   View Source Code Vote up 6 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
    View view = inflater.inflate(R.layout.fragment_reset_password, container, false);
    tilResetEmail = (DCTextInputLayout) view.findViewById(R.id.til_reset_email);
    tietResetEmail = (DCTextInputEditText) view.findViewById(R.id.tiet_reset_email);
    btnResetSend = (DCButton) view.findViewById(R.id.btn_reset_send);
    btnResetSend.setOnClickListener(this);
    tvResetSuccess = (DCTextView) view.findViewById(R.id.tv_reset_success);
    tvResetSuccess.setVisibility(View.GONE);
    llResetPassword = (LinearLayout) view.findViewById(R.id.ll_reset_password);
    llResetPassword.setVisibility(View.VISIBLE);
    btnResetOk = (DCButton) view.findViewById(R.id.btn_reset_ok);
    btnResetOk.setOnClickListener(this);
    btnResetOk.setVisibility(View.GONE);
    return view;
}
 
Example 5
Project: HiBangClient   File: BaseDialog.java   View Source Code Vote up 6 votes
private void initViews() {
mLayoutRoot = (LinearLayout) findViewById(R.id.dialog_generic_layout_root);
mLayoutTop = (LinearLayout) findViewById(R.id.dialog_generic_layout_top);
mLayoutTitle = (LinearLayout) findViewById(R.id.dialog_generic_layout_title);
mHtvTitle = (HandyTextView) findViewById(R.id.dialog_generic_htv_title);
mViewTitleLine = findViewById(R.id.dialog_generic_view_titleline);
mLayoutContent = (LinearLayout) findViewById(R.id.dialog_generic_layout_content);
mHtvMessage = (HandyTextView) findViewById(R.id.dialog_generic_htv_message);
mLayoutBottom = (LinearLayout) findViewById(R.id.dialog_generic_layout_bottom);
mBtnButton1 = (Button) findViewById(R.id.dialog_generic_btn_button1);
mBtnButton2 = (Button) findViewById(R.id.dialog_generic_btn_button2);
mBtnButton3 = (Button) findViewById(R.id.dialog_generic_btn_button3);
mLayoutRoot.setVisibility(View.VISIBLE);
setTitleLineVisibility(View.VISIBLE);

}
 
Example 6
Project: stynico   File: x5_MainActivity.java   View Source Code Vote up 6 votes
public void b3(View view)
{
       LinearLayout btnTwo = (LinearLayout) findViewById(R.id.mainLinearLayout1);
       if (isVisible)
	{
           isVisible = false;
           btnTwo.setVisibility(View.VISIBLE);
           //isVisible=true;
       }
	else
	{
           isVisible = true;
           btnTwo.setVisibility(View.GONE);

       }

   }
 
Example 7
Project: Flashcard-Maker-Android   File: DictionaryFragment.java   View Source Code Vote up 5 votes
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    if (savedInstanceState != null) {
        mHeaderDisplay = savedInstanceState
                .getInt(KEY_HEADER_POSITIONING,
                        getResources().getInteger(R.integer.default_header_display));
        mAreMarginsFixed = savedInstanceState
                .getBoolean(KEY_MARGINS_FIXED,
                        getResources().getBoolean(R.bool.default_margins_fixed));
    } else {
        mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
        mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
    }

    db = FlashcardDb.getInstance(getActivity().getApplicationContext());
    flashcards = db.getAllFlashcards();
    Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
    rv.setLayoutManager(new LayoutManager(getActivity()));
    //OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
    adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_dictionary)));
    adapter.setMarginsFixed(mAreMarginsFixed);
    adapter.setHeaderDisplay(mHeaderDisplay);
    rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));

    LinearLayout noSets = (LinearLayout)view.findViewById(R.id.no_sets);
    if (Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_dictionary)).isEmpty())
        noSets.setVisibility(View.VISIBLE);
    else
        noSets.setVisibility(View.GONE);
}
 
Example 8
Project: BTNotifierAndroid   File: ApplicationBlacklist.java   View Source Code Vote up 5 votes
public void checkIfEmpty() {
    LinearLayout linearLayout = (LinearLayout) findViewById(R.id.centerLayout);
    if (blacklistedApp.getBlacklistedAppList().isEmpty()) {
        linearLayout.setVisibility(View.VISIBLE);
    } else {
        linearLayout.setVisibility(View.GONE);
    }
}
 
Example 9
Project: Linphone4Android   File: LinphoneActivity.java   View Source Code Vote up 5 votes
private void changeFragmentForTablets(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) {
	if (getResources().getBoolean(R.bool.show_statusbar_only_on_dialer)) {
		if (newFragmentType == FragmentsAvailable.DIALER) {
			showStatusBar();
		} else {
			hideStatusBar();
		}
	}
	emptyFragment = false;
	LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);

	FragmentTransaction transaction = getFragmentManager().beginTransaction();

	if(newFragmentType == FragmentsAvailable.EMPTY){
		ll.setVisibility(View.VISIBLE);
		emptyFragment = true;
		transaction.replace(R.id.fragmentContainer2, newFragment);
		transaction.commitAllowingStateLoss();
		getFragmentManager().executePendingTransactions();
	} else {
		if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) {
			ll.setVisibility(View.VISIBLE);

			if (newFragmentType == FragmentsAvailable.CONTACT_EDITOR) {
				transaction.addToBackStack(newFragmentType.toString());
			}
			transaction.replace(R.id.fragmentContainer2, newFragment);
		} else {
			if (newFragmentType == FragmentsAvailable.EMPTY) {
				ll.setVisibility(View.VISIBLE);
				transaction.replace(R.id.fragmentContainer2, new EmptyFragment());
				emptyFragment = true;
			}

			if (newFragmentType == FragmentsAvailable.DIALER
					|| newFragmentType == FragmentsAvailable.ABOUT
					|| newFragmentType == FragmentsAvailable.SETTINGS
					|| newFragmentType == FragmentsAvailable.ACCOUNT_SETTINGS) {
				ll.setVisibility(View.GONE);
			} else {
				ll.setVisibility(View.VISIBLE);
				transaction.replace(R.id.fragmentContainer2, new EmptyFragment());
			}

			/*if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) {
				if (newFragmentType.isRightOf(currentFragment)) {
					transaction.setCustomAnimations(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left, R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right);
				} else {
					transaction.setCustomAnimations(R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right, R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left);
				}
			}*/
			transaction.replace(R.id.fragmentContainer, newFragment);
		}
		transaction.commitAllowingStateLoss();
		getFragmentManager().executePendingTransactions();

		currentFragment = newFragmentType;
		if (newFragmentType == FragmentsAvailable.DIALER
				|| newFragmentType == FragmentsAvailable.SETTINGS
				|| newFragmentType == FragmentsAvailable.CONTACTS_LIST
				|| newFragmentType == FragmentsAvailable.CHAT_LIST
				|| newFragmentType == FragmentsAvailable.HISTORY_LIST) {
			try {
				getFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
			} catch (IllegalStateException e) {

			}
		}
		fragmentsHistory.add(currentFragment);
	}
}
 
Example 10
Project: Traveler-List   File: DetailActivity.java   View Source Code Vote up 5 votes
private void revealEditText(LinearLayout view) {

    int cx = view.getRight() - 30;
    int cy = view.getBottom() - 60;
    int finalRadius = Math.max(view.getWidth(), view.getHeight());
    Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
    view.setVisibility(View.VISIBLE);
    isEditTextVisible = true;
    anim.start();
  }
 
Example 11
Project: boohee_v5.6   File: SummaryActivity.java   View Source Code Vote up 5 votes
private void initDietCart(int time_type, ArrayList<RecordFood> foodRcordList,
                          ArrayList<RecordPhoto> recordPhotoList, LinearLayout ll_card) {
    if ((foodRcordList == null || foodRcordList.size() <= 0) && (recordPhotoList == null ||
            recordPhotoList.size() <= 0)) {
        ll_card.setVisibility(8);
        return;
    }
    int i;
    ll_card.setVisibility(0);
    TextView tv_des = (TextView) ll_card.findViewById(R.id.tv_des);
    ((TextView) ll_card.findViewById(R.id.tv_time_type)).setText(FoodUtils.getDietName(this
            .activity, time_type));
    StringBuffer sb = new StringBuffer();
    for (i = 0; i < foodRcordList.size(); i++) {
        sb.append(String.format("%1$s%2$s%3$s, ", new Object[]{((RecordFood) foodRcordList
                .get(i)).food_name, Float.valueOf(((RecordFood) foodRcordList.get(i)).amount)
                , ((RecordFood) foodRcordList.get(i)).unit_name}));
        this.totalDietCalory += food.calory;
    }
    for (i = 0; i < recordPhotoList.size(); i++) {
        RecordPhoto photo = (RecordPhoto) recordPhotoList.get(i);
        String str = "%1$s, ";
        Object[] objArr = new Object[1];
        objArr[0] = TextUtils.isEmpty(photo.name) ? "拍照记录" : photo.name;
        sb.append(String.format(str, objArr));
        if (photo.status != 1) {
            this.totalDietCalory += photo.calory;
        }
    }
    tv_des.setText(sb.subSequence(0, sb.lastIndexOf(",")).toString());
}
 
Example 12
Project: phonk   File: ProjectListFragment.java   View Source Code Vote up 4 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mContext = getActivity();

    View v;
    if (mListMode) {
        v = inflater.inflate(R.layout.projectlist_list, container, false);
    } else {
        v = inflater.inflate(R.layout.projectlist_grid, container, false);
    }

    // Get GridView and set adapter
    mGrid = (FitRecyclerView) v.findViewById(R.id.gridprojects);
    mGrid.setItemAnimator(new DefaultItemAnimator());

    // set the empty state
    mEmptyGrid = (LinearLayout) v.findViewById(R.id.empty_grid_view);
    // checkEmptyState();
    registerForContextMenu(mGrid);

    if (mProjectFolder != "") loadFolder(mProjectFolder);

    mBackToFolderButton = (ImageButton) v.findViewById(R.id.backToFolders);
    mTxtParentFolder = (TextView) v.findViewById(R.id.parentFolder);
    mTxtFolder = (TextView) v.findViewById(R.id.folder);
    mFolderPath = (LinearLayout) v.findViewById(R.id.folderPath);
    mSelectFolder = (LinearLayout) v.findViewById(R.id.select_folder);

    mBackToFolderButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            EventBus.getDefault().post(new Events.AppUiEvent("page", 1));
            // show folderlist
            // if (isShown)
            // else
        }
    });

    mIsTablet = getResources().getBoolean(R.bool.isTablet);
    LinearLayout llFolderLocation = (LinearLayout) v.findViewById(R.id.folderLocation2);
    if (mIsTablet) llFolderLocation.setVisibility(View.GONE);

    // TODO add the bottom bar any day.....
    mBottomBar = (LinearLayout) v.findViewById(R.id.bottombar);
    mBottomBar.setVisibility(View.GONE);
    /*
    mBottomBar.setTranslationY(AndroidUtils.dpToPixels(mContext, 52));
    mBottomBar.animate().translationY(AndroidUtils.dpToPixels(mContext, 0)).setDuration(5000).start();
    */

    return v;
}
 
Example 13
Project: wallpaperboard   File: WallpaperBoardActivity.java   View Source Code Vote up 4 votes
private void initNavigationViewHeader() {
    if (WallpaperBoardApplication.getConfig().getNavigationViewHeader() ==
            WallpaperBoardConfiguration.NavigationViewHeader.NONE) {
        mNavigationView.removeHeaderView(mNavigationView.getHeaderView(0));
        return;
    }

    String imageUrl = getResources().getString(R.string.navigation_view_header);
    String titleText = getResources().getString(R.string.navigation_view_header_title);
    View header = mNavigationView.getHeaderView(0);

    HeaderView image = header.findViewById(R.id.header_image);
    LinearLayout container = header.findViewById(R.id.header_title_container);
    TextView title = header.findViewById(R.id.header_title);
    TextView version = header.findViewById(R.id.header_version);

    if (WallpaperBoardApplication.getConfig().getNavigationViewHeader() ==
            WallpaperBoardConfiguration.NavigationViewHeader.MINI) {
        image.setRatio(16, 9);
    }

    if (titleText.length() == 0) {
        container.setVisibility(View.GONE);
    } else {
        title.setText(titleText);
        try {
            String versionText = "v" + getPackageManager()
                    .getPackageInfo(getPackageName(), 0).versionName;
            version.setText(versionText);
        } catch (Exception ignored) {}
    }

    if (ColorHelper.isValidColor(imageUrl)) {
        image.setBackgroundColor(Color.parseColor(imageUrl));
        return;
    }

    if (!URLUtil.isValidUrl(imageUrl)) {
        imageUrl = "drawable://" + DrawableHelper.getResourceId(this, imageUrl);
    }

    ImageLoader.getInstance().displayImage(imageUrl, new ImageViewAware(image),
            ImageConfig.getDefaultImageOptions(), new ImageSize(720, 720), null, null);
}
 
Example 14
Project: cute-currency-view   File: CuteCurrencyView.java   View Source Code Vote up 4 votes
private void animateCharViews(View[] viewsToAnimate,
                              final LinearLayout parentView, final EditText editText) {

    // first, make sure the items are out of sight
    // by moving them by their height (maybe use parent's height?)

    for (View viewToAnimate : viewsToAnimate) {
        int height = viewToAnimate.getHeight();
        float y = viewToAnimate.getY();
        viewToAnimate.setY(y + height);
    }

    // now the whole container can be visible since the views are clipped
    parentView.setVisibility(View.VISIBLE);

    for (int i = 0; i < viewsToAnimate.length; i++) {

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(
                ObjectAnimator.ofFloat(viewsToAnimate[i], "translationY", 0));
        animatorSet.setInterpolator(new SimpleSpringInterpolator());
        animatorSet.setDuration(700);
        animatorSet.setStartDelay(i * 100);

        if (i == viewsToAnimate.length - 1) {
            // when the last char finishes animating,
            // hide parent container and show the EditText

            animatorSet.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    parentView.removeAllViews();
                    parentView.setVisibility(View.GONE);
                    if (!TextUtils.isEmpty(editText.getText()))
                        editText.setSelection(editText.getText().length());
                    editText.setVisibility(View.VISIBLE);
                }
            });
        }

        animatorSet.start();
    }
}
 
Example 15
Project: Hillffair17   File: ProfileTab2.java   View Source Code Vote up 4 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){


    View view = inflater.inflate(R.layout.fragment_profiletab2, container, false);


    sharedPref = new SharedPref(getContext());

    cardView = (CardView) view.findViewById(R.id.cardview);
    textName = (TextView) view.findViewById(R.id.name);
    textRollno = (TextView) view.findViewById(R.id.rollno);
    textEmail = (TextView) view.findViewById(R.id.email);
    rollnoLayout = (LinearLayout) view.findViewById(R.id.rollnoLayout);

    if(savedInstanceState==null){

       String name="",email="",rollNo="";
        name=sharedPref.getUserName();
        email=sharedPref.getUserEmail();
        rollNo=sharedPref.getUserRollno();
        if(!name.isEmpty() && !email.isEmpty()){
            cardView.setVisibility(View.VISIBLE);
            textName.setText(name);
            textEmail.setText(email);
            if(!rollNo.isEmpty()){
                textRollno.setText(rollNo);
            }
            else {
                rollnoLayout.setVisibility(View.GONE);
            }
        }


    }
    else{

        cardView.setVisibility(View.VISIBLE);
        if(savedInstanceState.getString(USER_NAME)!=null&&!savedInstanceState.getString(USER_NAME).isEmpty()){
            textName.setText(savedInstanceState.getString(USER_NAME));
        }
        else {
            textName.setVisibility(View.GONE);
        }
        if(savedInstanceState.getString(USER_EMAIL)!=null&&!savedInstanceState.getString(USER_EMAIL).isEmpty()){
            textEmail.setText(savedInstanceState.getString(USER_EMAIL));
        }
        else {
            textEmail.setVisibility(View.GONE);
        }
        if(savedInstanceState.getString(USER_ROLLNO)!=null&&!savedInstanceState.getString(USER_ROLLNO).isEmpty()){
            textRollno.setText(savedInstanceState.getString(USER_ROLLNO));
        }
        else {
            textRollno.setVisibility(View.GONE);
        }
    }




    return view;
}
 
Example 16
Project: oma-riista-android   File: GameCalendar.java   View Source Code Vote up 4 votes
public void showCategories(boolean show) {
    LinearLayout categoriesView = (LinearLayout) findViewById(R.id.categories);
    categoriesView.setVisibility(show ? View.VISIBLE : View.GONE);
}
 
Example 17
Project: Wings2K16   File: GalleryActivity.java   View Source Code Vote up 4 votes
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.gallery_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        ActionBar actionbar= getSupportActionBar();

        actionbar.setTitle("Gallery");
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        LinearLayout errorLayout = (LinearLayout)findViewById(R.id.error);
        LinearLayout contLayout = (LinearLayout)findViewById(R.id.content);
        if (!com.geca.wings.NetworkUtil.isNetworkConnected(GalleryActivity.this)){

            errorLayout.setVisibility(View.VISIBLE);
            contLayout.setVisibility(View.GONE);
        }else {
            progressBar = (SmoothProgressBar) findViewById(R.id.progressbar);
            // Create default options which will be used for every
            //  displayImage(...) call if no options will be passed to this method
            DisplayImageOptions options = new DisplayImageOptions.Builder()
                    .showImageForEmptyUri(R.drawable.wingslogos)
                    .showImageOnFail(R.drawable.wingslogos)
                    .resetViewBeforeLoading(true)
                    .cacheOnDisk(true)
                    .imageScaleType(ImageScaleType.EXACTLY)
                    .bitmapConfig(Bitmap.Config.RGB_565)
                    .considerExifParams(true)
                    .displayer(new FadeInBitmapDisplayer(300))
                    .displayer(new RoundedBitmapDisplayer(10))
                    .build();

            ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
                    .defaultDisplayImageOptions(options)
                    .threadPriority(Thread.NORM_PRIORITY - 2)
                    .denyCacheImageMultipleSizesInMemory()
                    .diskCacheFileNameGenerator(new Md5FileNameGenerator())
                    .diskCacheSize(50 * 1024 * 1024) // 50 Mb
                    .tasksProcessingOrder(QueueProcessingType.LIFO)

                    .build();
            ImageLoader.getInstance().init(config); // Do it on Application start

            lvMovies = (GridView) findViewById(R.id.lvMovies);

//                new JSONTask().execute("http://jsonparsing.parseapp.com/jsonData/moviesDemoList.txt");
//                new JSONTask().execute("http://jsonparsing.parseapp.com/jsonData/moviesDemoItem.txt");
            new JSONTask().execute("http://wings2k16.comlu.com/gallery.json");
        }
        }
 
Example 18
Project: MyFlightbookAndroid   File: ExpandableListFragment.java   View Source Code Vote up 4 votes
/**
* Provide default implementation to return a simple list view. Subclasses
* can override to replace with their own layout. If doing so, the
* returned view hierarchy <em>must</em> have a ListView whose id
* is {@link android.R.id#list android.R.id.list} and can optionally
* have a sibling view id {@link android.R.id#empty android.R.id.empty}
* that is to be shown when the list is empty.
*
* <p>If you are overriding this method with your own custom content,
* consider including the standard layout {@link android.R.layout#list_content}
* in your layout file, so that you continue to retain all of the standard
* behavior of ListFragment. In particular, this is currently the only
* way to have the built-in indeterminant progress state be shown.
*/
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        final Context context = getActivity();

        FrameLayout root = new FrameLayout(context);

        // ------------------------------------------------------------------

        LinearLayout pframe = new LinearLayout(context);
        pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
        pframe.setOrientation(LinearLayout.VERTICAL);
        pframe.setVisibility(View.GONE);
        pframe.setGravity(Gravity.CENTER);

        ProgressBar progress = new ProgressBar(context, null,
                android.R.attr.progressBarStyleLarge);
        pframe.addView(progress, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

        root.addView(pframe, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        // ------------------------------------------------------------------

        FrameLayout lframe = new FrameLayout(context);
        lframe.setId(INTERNAL_LIST_CONTAINER_ID);

        TextView tv = new TextView(getActivity());
        tv.setId(INTERNAL_EMPTY_ID);
        tv.setGravity(Gravity.CENTER);
        lframe.addView(tv, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        ExpandableListView lv = new ExpandableListView(getActivity());
        lv.setId(android.R.id.list);
        lv.setDrawSelectorOnTop(false);
        lframe.addView(lv, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        root.addView(lframe, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        // ------------------------------------------------------------------

        root.setLayoutParams(new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

        return root;
    }
 
Example 19
Project: letv   File: HalfPlaySharePopwindow.java   View Source Code Vote up 4 votes
private void initUI() {
    onFragmentResult = new onFragmentResult(this) {
        final /* synthetic */ HalfPlaySharePopwindow this$0;

        {
            if (HotFix.PREVENT_VERIFY) {
                System.out.println(VerifyLoad.class);
            }
            this.this$0 = this$0;
        }

        public void onFragmentResult_back(int requestCode, int resultCode, Intent data) {
            if (this.this$0.mSsoHandler != null) {
                this.this$0.mSsoHandler.authorizeCallBack(requestCode, resultCode, data);
            }
        }
    };
    mFacebookCallbackManager = Factory.create();
    ((HorizontalScrollView) this.mRootView.findViewById(2131362442)).setVisibility(8);
    this.mRootView.findViewById(2131362443).setVisibility(8);
    this.mTransparentView = this.mRootView.findViewById(2131362426);
    this.mTransparentView.setOnClickListener(this);
    LinearLayout wx_timeline_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362428);
    LinearLayout weixin_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362430);
    LinearLayout sina_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362432);
    LinearLayout qzone_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362434);
    LinearLayout tencent_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362438);
    LinearLayout qq_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362436);
    LinearLayout facebook_invite_layout = (LinearLayout) this.mRootView.findViewById(2131362440);
    if (LetvUtils.isInHongKong()) {
        wx_timeline_invite_layout.setVisibility(8);
        weixin_invite_layout.setVisibility(8);
        sina_invite_layout.setVisibility(8);
        qzone_invite_layout.setVisibility(8);
        tencent_invite_layout.setVisibility(8);
        qq_invite_layout.setVisibility(8);
        facebook_invite_layout.setVisibility(0);
    } else {
        wx_timeline_invite_layout.setVisibility(0);
        weixin_invite_layout.setVisibility(0);
        sina_invite_layout.setVisibility(0);
        qzone_invite_layout.setVisibility(0);
        tencent_invite_layout.setVisibility(0);
        qq_invite_layout.setVisibility(0);
        facebook_invite_layout.setVisibility(8);
    }
    this.mWxFriendsImageView = (ImageView) this.mRootView.findViewById(2131362429);
    this.mWxFriendsImageView.setOnClickListener(this);
    this.mWxImageView = (ImageView) this.mRootView.findViewById(2131362431);
    this.mWxImageView.setOnClickListener(this);
    this.mSinaImageView = (ImageView) this.mRootView.findViewById(2131362433);
    this.mSinaImageView.setOnClickListener(this);
    this.mQzoneImageView = (ImageView) this.mRootView.findViewById(2131362435);
    this.mQzoneImageView.setOnClickListener(this);
    this.mQQImageView = (ImageView) this.mRootView.findViewById(2131362437);
    this.mQQImageView.setOnClickListener(this);
    this.mFacebookImageView = (ImageView) this.mRootView.findViewById(2131362441);
    this.mFacebookImageView.setOnClickListener(this);
    this.mTencentWeiboImageView = (ImageView) this.mRootView.findViewById(2131362439);
    this.mTencentWeiboImageView.setOnClickListener(this);
    this.mCancleTextView = (TextView) this.mRootView.findViewById(2131362444);
    this.mCancleTextView.setOnClickListener(this);
    if (this.mShareFrom == 8 || this.mShareFrom == 10) {
        sina_invite_layout.setVisibility(8);
        qzone_invite_layout.setVisibility(8);
        qq_invite_layout.setVisibility(8);
        tencent_invite_layout.setVisibility(8);
    } else if (this.mShareFrom == 11) {
        tencent_invite_layout.setVisibility(8);
    }
}
 
Example 20
Project: MrTranslator   File: MainActivity.java   View Source Code Vote up 2 votes
private void initViews(){

        toolbar= (Toolbar) findViewById(R.id.toolbar);

        setSupportActionBar(toolbar);

        editText= (EditText)findViewById(R.id.word_input);

        button= (FloatingActionButton)findViewById(R.id.translate_btn);

        button.setVisibility(View.INVISIBLE);

        translationLayout= (LinearLayout) findViewById(R.id.translation_layout);

        phoneticText= (TextView) findViewById(R.id.phonetic_text);

        explainsLayout= (LinearLayout) findViewById(R.id.explains_layout);

        queryText= (TextView) findViewById(R.id.query_text);

        webLayout= (LinearLayout) findViewById(R.id.web_layout);

        progressBar= (ProgressBar) findViewById(R.id.progress_bar);

        clearView= (ImageView) findViewById(R.id.iv_clear);

        clearView.setVisibility(View.INVISIBLE);

        copyImage= (ImageView) findViewById(R.id.copy);

        copyImage.setVisibility(View.INVISIBLE);

        shareImage= (ImageView) findViewById(R.id.share);

        shareImage.setVisibility(View.INVISIBLE);

        translateTitle= (TextView) findViewById(R.id.translate_title);

        explainsTitle= (TextView) findViewById(R.id.explains_title);

        webTitle= (TextView) findViewById(R.id.web_title);

        mixLayout= (LinearLayout) findViewById(R.id.mixLayout);

        mixLayout.setVisibility(View.INVISIBLE);

        mDrawerLayout= (DrawerLayout) findViewById(R.id.drawer_layout);

        navigationView= (NavigationView) findViewById(R.id.nav_view);

        collectImage= (ImageView) findViewById(R.id.collect);

        collectImage.setVisibility(View.INVISIBLE);

        collectDoneImage= (ImageView) findViewById(R.id.collect_done);

        collectDoneImage.setVisibility(View.INVISIBLE);

        ActionBar actionBar=getSupportActionBar();

        if(actionBar!=null){

            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setHomeAsUpIndicator(R.drawable.ic_menu_white_24dp);
        }

    }