Example usage for android.widget LinearLayout setVisibility

List of usage examples for android.widget LinearLayout setVisibility

Introduction

In this page you can find the example usage for android.widget LinearLayout setVisibility.

Prototype

@RemotableViewMethod
public void setVisibility(@Visibility int visibility) 

Source Link

Document

Set the visibility state of this view.

Usage

From source file:com.inovex.zabbixmobile.activities.fragments.BaseSeverityFilterDetailsFragment.java

/**
 * Dismisses the loading spinner view.// w w  w.  ja v a  2s  .c om
 * 
 * If the view has not yet been created, the status is saved and when the
 * view is created, the spinner will not be shown at all.
 */
public void dismissLoadingSpinner() {
    mLoadingSpinnerVisible = false;
    if (getView() != null) {
        LinearLayout progressLayout = (LinearLayout) getView()
                .findViewById(R.id.severity_details_progress_layout);
        if (progressLayout != null) {
            progressLayout.setVisibility(View.GONE);
        }
    }

}

From source file:com.mb.kids_mind.Adapter.SimilarListAdapter2.java

public void requestMyImage(final ImageView loading, final LinearLayout loadinglinear, ImageView image,
        String userImagePath) {/*from ww w  . ja v  a  2s  . c o m*/
    AQuery aq = new AQuery(image);
    loading.setVisibility(View.VISIBLE);
    loadinglinear.setVisibility(View.VISIBLE);
    loadingViewAnim.start();
    if (userImagePath.equals("")) {
        // aq.id(R.id.my_image).image(R.drawable.photo1);  
    } else {
        String url = Const.IMAGE_LOAD_URL + "/" + userImagePath;
        url = url.trim();
        aq.image(url, false, false, 0, 0, new BitmapAjaxCallback() { // my_image <== ImageView
            @Override
            public void callback(String url, ImageView iv, Bitmap bm, AjaxStatus status) {

                if (bm != null) {
                    loading.setVisibility(View.GONE);
                    loadinglinear.setVisibility(View.GONE);
                    loadingViewAnim.stop();
                    iv.setImageBitmap(bm);
                }
            }
        });
    }
}

From source file:com.brewcrewfoo.performance.fragments.BatteryInfo.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup root, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.battery_info, root, false);

    mbattery_percent = (TextView) view.findViewById(R.id.batt_percent);
    mbattery_volt = (TextView) view.findViewById(R.id.batt_volt);
    mbattery_status = (TextView) view.findViewById(R.id.batt_status);
    mBattIcon = (ImageView) view.findViewById(R.id.batt_icon);

    if (new File(BAT_VOLT_PATH).exists()) {
        int volt = Integer.parseInt(Helpers.readOneLine(BAT_VOLT_PATH));
        if (volt > 5000)
            volt = (int) Math.round(volt / 1000.0);// in microvolts
        mbattery_volt.setText(volt + " mV");
        mBattIcon.setVisibility(ImageView.GONE);
        mbattery_volt.setVisibility(TextView.VISIBLE);
        mbattery_volt.setOnClickListener(new View.OnClickListener() {
            @Override//ww  w  . j a v a 2 s. c o m
            public void onClick(View view) {
                Intent powerUsageIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
                if (powerUsageIntent.resolveActivity(context.getPackageManager()) != null)
                    startActivity(powerUsageIntent);
            }
        });
        mbattery_volt.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                mBattIcon.setVisibility(ImageView.VISIBLE);
                mbattery_volt.setVisibility(TextView.GONE);
                return true;
            }
        });
    } else {
        mBattIcon.setVisibility(ImageView.VISIBLE);
        mbattery_volt.setVisibility(TextView.GONE);
        mBattIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                try {
                    Intent powerUsageIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
                    startActivity(powerUsageIntent);
                } catch (Exception e) {
                }
            }
        });
    }

    SeekBar mBlxSlider = (SeekBar) view.findViewById(R.id.blx_slider);
    if (new File(BLX_PATH).exists()) {
        no_settings = false;
        mBlxSlider.setMax(100);

        mBlxVal = (TextView) view.findViewById(R.id.blx_val);
        mBlxVal.setText(getString(R.string.blx_title) + " " + Helpers.readOneLine(BLX_PATH) + "%");

        mBlxSlider.setProgress(Integer.parseInt(Helpers.readOneLine(BLX_PATH)));
        mBlxSlider.setOnSeekBarChangeListener(this);
        Switch mSetOnBoot = (Switch) view.findViewById(R.id.blx_sob);
        mSetOnBoot.setChecked(mPreferences.getBoolean(BLX_SOB, false));
        mSetOnBoot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton v, boolean checked) {
                final SharedPreferences.Editor editor = mPreferences.edit();
                editor.putBoolean(BLX_SOB, checked);
                if (checked) {
                    editor.putInt(PREF_BLX, Integer.parseInt(Helpers.readOneLine(BLX_PATH)));
                }
                editor.commit();
            }
        });
    } else {
        LinearLayout mpart = (LinearLayout) view.findViewById(R.id.blx_layout);
        mpart.setVisibility(LinearLayout.GONE);
    }
    mFastChargePath = Helpers.fastcharge_path();
    if (mFastChargePath != null) {
        no_settings = false;
        mFastchargeOnBoot = (Switch) view.findViewById(R.id.fastcharge_sob);
        mFastchargeOnBoot.setChecked(
                mPreferences.getBoolean(PREF_FASTCHARGE, Helpers.readOneLine(mFastChargePath).equals("1")));
        mFastchargeOnBoot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton v, boolean checked) {
                mPreferences.edit().putBoolean(PREF_FASTCHARGE, checked).apply();
                final NotificationManager nm = (NotificationManager) context
                        .getSystemService(Context.NOTIFICATION_SERVICE);
                if (checked) {
                    new CMDProcessor().su.runWaitFor("busybox echo 1 > " + mFastChargePath);
                    Notification n = new Notification.Builder(context)
                            .setContentTitle(context.getText(R.string.app_name))
                            .setContentText(context.getText(R.string.fast_charge_notification_title))
                            .setTicker(context.getText(R.string.fast_charge_notification_title))
                            .setSmallIcon(R.drawable.ic_fastcharge).setWhen(System.currentTimeMillis())
                            .getNotification();
                    //n.flags = Notification.FLAG_NO_CLEAR;
                    nm.notify(1337, n);
                } else {
                    new CMDProcessor().su.runWaitFor("busybox echo 0 > " + mFastChargePath);
                    nm.cancel(1337);
                }
            }
        });
    } else {
        LinearLayout mpart = (LinearLayout) view.findViewById(R.id.fastcharge_layout);
        mpart.setVisibility(LinearLayout.GONE);
    }
    if (no_settings) {
        LinearLayout ns = (LinearLayout) view.findViewById(R.id.no_settings);
        ns.setVisibility(LinearLayout.VISIBLE);
    }

    return view;
}

From source file:com.ibuildapp.romanblack.MultiContactsPlugin.MultiContactsActivity.java

@Override
public void create() {
    try {//from   ww  w  .  jav a  2  s  .  c o  m
        setContentView(R.layout.grouped_contacts_main);

        setTopBarLeftButtonTextAndColor(getResources().getString(R.string.common_back_upper),
                getResources().getColor(android.R.color.black), true, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        finish();
                        return;
                    }
                });
        setTopBarTitleColor(getResources().getColor(android.R.color.black));
        setTopBarBackgroundColor(Statics.color1);

        LinearLayout inputSearchLayout = (LinearLayout) findViewById(R.id.grouped_contacts_search_layout);
        inputSearchLayout.setVisibility(View.GONE);

        resources = getResources();

        Intent currentIntent = getIntent();
        Bundle store = currentIntent.getExtras();
        widget = (Widget) store.getSerializable("Widget");
        category = store.getString("category");
        setTopBarTitle(category);

        if (widget == null) {
            handler.sendEmptyMessage(INITIALIZATION_FAILED);
            return;
        }

        cachePath = widget.getCachePath() + "/contacts-" + widget.getOrder();

        root = (LinearLayout) findViewById(R.id.grouped_contacts_main_root);
        listView = (ListView) findViewById(R.id.grouped_contacts_list);
        separator = findViewById(R.id.gc_head_separator);
        backSeparator = findViewById(R.id.gc_back_separator);

        backSeparator.setBackgroundColor(Statics.color1);
        if (Statics.isLight) {
            separator.setBackgroundColor(Color.parseColor("#4d000000"));
        } else {
            separator.setBackgroundColor(Color.parseColor("#4dFFFFFF"));
        }

        handler.sendEmptyMessage(SET_ROOT_BACKGROUND);
    } catch (Exception e) {
    }
}

From source file:org.secuso.privacyfriendlypasswordgenerator.dialogs.AddMetaDataDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    LayoutInflater inflater = getActivity().getLayoutInflater();
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    rootView = inflater.inflate(R.layout.dialog_add_metadata, null);

    versionVisible = false;/*from  ww  w .  j ava  2s. c om*/

    builder.setView(rootView);
    builder.setIcon(R.mipmap.ic_drawer);
    builder.setTitle(getActivity().getString(R.string.add_metadata_heading));

    database = MetaDataSQLiteHelper.getInstance(getActivity());

    //Seekbar
    SeekBar seekBarLength = (SeekBar) rootView.findViewById(R.id.seekBarLength);
    final TextView textViewLengthDisplayFinal = (TextView) rootView.findViewById(R.id.textViewLengthDisplay);
    seekBarLength.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            textViewLengthDisplayFinal.setText(Integer.toString(progress + 4));
        }

        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });

    ImageButton versionInfoImageButton = (ImageButton) rootView.findViewById(R.id.versionInfoImageButton);
    versionInfoImageButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            AlertDialog.Builder infoBbuilder = new AlertDialog.Builder(getActivity());
            infoBbuilder.setTitle(getString(R.string.dialog_version_title));
            infoBbuilder.setMessage(R.string.dialog_version);
            infoBbuilder.show();
        }

    });

    Button versionButton = (Button) rootView.findViewById(R.id.versionButton);
    versionButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            LinearLayout versionDataLayout = (LinearLayout) rootView.findViewById(R.id.versionDataLayout);
            TextView versionTextView = (TextView) rootView.findViewById(R.id.versionButton);
            if (!versionVisible) {
                versionDataLayout.setVisibility(View.VISIBLE);
                versionTextView.setText(getString(R.string.change_version_opened));
                versionTextView.setTextColor(Color.BLACK);
                versionVisible = true;
            } else {
                versionDataLayout.setVisibility(View.GONE);
                versionTextView.setText(getString(R.string.change_version_closed));
                versionTextView.setTextColor(Color.parseColor("#d3d3d3"));
                versionVisible = false;
            }

        }

    });

    EditText iterations = (EditText) rootView.findViewById(R.id.EditTextIteration);
    iterations.setText("1");

    builder.setPositiveButton(getActivity().getString(R.string.add), new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {

            addMetaData();

        }
    });

    builder.setNegativeButton(getActivity().getString(R.string.cancel), null);

    return builder.create();
}

From source file:eisene.riskspeedtools.BattleFrag.java

/**
 * Sets the mode (dice or blitz)./*  w  ww.  ja  v a 2 s.  co  m*/
 * @param toBlitzMode True to set to blitz mode, false to set to dice mode.
 */
public void setMode(boolean toBlitzMode) {
    LinearLayout blitzFrame = (LinearLayout) findViewById(R.id.blitz_frame);
    LinearLayout diceFrame = (LinearLayout) findViewById(R.id.dice_frame);

    if (toBlitzMode) {
        blitzFrame.setVisibility(View.VISIBLE);
        diceFrame.setVisibility(View.GONE);
    } else {
        diceFrame.setVisibility(View.VISIBLE);
        blitzFrame.setVisibility(View.GONE);
    }
}

From source file:org.mariotaku.twidere.fragment.support.BaseSupportListFragment.java

/**
 * 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.//from  ww w .j  av  a2s .  c o  m
 * 
 * <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(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    final Context context = getActivity();

    final FrameLayout root = new FrameLayout(context);

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

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

    final 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));

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

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

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

    final ListView lv = new ListView(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;
}

From source file:com.cssweb.android.quote.QuoteDetail.java

/**
 * //ww w.  j a v a  2  s. c om
 * @param jArr
 * @param table
 * @param zrsp
 * @throws JSONException
 */
private void appendRow(JSONArray jArr, TableLayout table, double zrsp) throws JSONException {
    table.setStretchAllColumns(true);
    table.removeAllViews();

    if ("cf".equals(exchange.toLowerCase()) || "dc".equals(exchange.toLowerCase())
            || "sf".equals(exchange.toLowerCase()) || "cz".equals(exchange.toLowerCase())) {
        int len = jArr.length();
        int color = Utils.getTextColor(mContext, 0);
        for (int i = 0; i < len; i++) {
            LinearLayout linearLayout = (LinearLayout) findViewById(R.id.title23);
            linearLayout.setVisibility(View.VISIBLE);

            JSONArray jA = (JSONArray) jArr.get(i);
            TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.zr_quote_price_item, null);
            TextView t1 = (TextView) row.findViewById(R.id.zr_table_col1);
            TextView t2 = (TextView) row.findViewById(R.id.zr_table_col2);
            TextView t3 = (TextView) row.findViewById(R.id.zr_table_col3);
            TextView t4 = (TextView) row.findViewById(R.id.zr_table_col4);
            TextView t5 = (TextView) row.findViewById(R.id.zr_table_col5);
            t1.setText(jA.getString(4));
            t2.setText(Utils.dataFormation(jA.getDouble(0), Utils.getStockDigit(type)));
            t2.setTextColor(Utils.getTextColor(mContext, jA.getDouble(0), zrsp));
            t2.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            double cjsl = Arith.round(jA.getDouble(1), 0);
            t3.setText(Utils.dataFormation(cjsl, 0));
            t3.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            t4.setText(jA.getString(7));
            t5.setText(jA.getString(8));
            table.addView(row);
            if ("B".equals(jA.getString(6))) {
                color = Utils.getTextColor(mContext, 3);
                t3.setTextColor(color);
                t4.setTextColor(color);
                t5.setTextColor(color);
            } else if ("S".equals(jA.getString(6))) {
                color = Utils.getTextColor(mContext, 4);
                t3.setTextColor(color);
                t4.setTextColor(color);
                t5.setTextColor(color);
            } else {
                t3.setTextColor(color);
                t4.setTextColor(color);
                t5.setTextColor(color);
            }
        }
    } else {
        if (stocktype.charAt(0) == '0') {//
            //for (int i = jArr.length()-1; i >= 0; i--) {
            for (int i = 0; i <= jArr.length() - 1; i++) {
                JSONArray jA = (JSONArray) jArr.get(i);
                TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.zr_quote_price_item, null);
                TextView t1 = (TextView) row.findViewById(R.id.zr_table_col1);
                TextView t2 = (TextView) row.findViewById(R.id.zr_table_col2);
                TextView t3 = (TextView) row.findViewById(R.id.zr_table_col3);
                TextView t4 = (TextView) row.findViewById(R.id.zr_table_col4);
                t1.setText(jA.getString(4));
                t2.setText(Utils.dataFormation(jA.getDouble(0), Utils.getStockDigit(type)));
                t2.setTextColor(Utils.getTextColor(mContext, jA.getDouble(0), zrsp));
                t2.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
                double cjsl = Arith.round(jA.getDouble(1), 0);
                t3.setText(Utils.dataFormation(cjsl, 0));
                if (cjsl > 500)
                    t3.setTextColor(Utils.getTextColor(mContext, 6));
                else
                    t3.setTextColor(Utils.getTextColor(mContext, 1));
                t3.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
                t4.setText(jA.getString(6));
                if ("B".equals(jA.getString(6)))
                    t4.setTextColor(Utils.getTextColor(mContext, 3));
                else
                    t4.setTextColor(Utils.getTextColor(mContext, 4));
                table.addView(row);
            }
            //?
            int num = jArr.length();
            if (num < 16) {
                while (num < 16) {
                    TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.zr_quote_price_item,
                            null);
                    table.addView(row);
                    num++;
                }
            }
        } else if (stocktype.charAt(0) == '1' || stocktype.charAt(0) == '2') {//
            //for (int i = jArr.length()-1; i >= 0; i--) {
            for (int i = 0; i <= jArr.length() - 1; i++) {
                JSONArray jA = (JSONArray) jArr.get(i);
                TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.zr_quote_price_item, null);
                TextView t1 = (TextView) row.findViewById(R.id.zr_table_col1);
                TextView t2 = (TextView) row.findViewById(R.id.zr_table_col2);
                TextView t3 = (TextView) row.findViewById(R.id.zr_table_col4);
                t1.setText(jA.getString(4));
                t2.setText(Utils.dataFormation(jA.getDouble(0), Utils.getStockDigit(type)));
                t2.setTextColor(Utils.getTextColor(mContext, jA.getDouble(0), zrsp));
                t3.setText(Utils.getAmountFormat(jA.getDouble(5), true));
                t3.setTextColor(Utils.getTextColor(mContext, 1));
                table.addView(row);
            }
            //?
            int num = jArr.length();
            if (num < 16) {
                while (num < 16) {
                    TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.zr_quote_price_item,
                            null);
                    table.addView(row);
                    num++;
                }
            }
        }
    }

}

From source file:il.co.togetthere.ScreenSlideActivity.java

@SuppressLint("InlinedApi")
@Override//from w  w w.j  a va  2 s .  com
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_screen_slide);

    // Start to import data from DB
    mThread.delegate = this;
    mCurr = -1;

    /**
     * View Initialization
     **/

    // Hide the status bar.
    //View decorView = getWindow().getDecorView();
    //int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    //decorView.setSystemUiVisibility(uiOptions);

    // Remember that you should never show the action bar if the
    // status bar is hidden, so hide that too if necessary.
    android.app.ActionBar actionBar = getActionBar();
    actionBar.hide();

    /**
     * Set Profile Picture
     **/
    ProfilePictureView profilePictureView = (ProfilePictureView) findViewById(
            R.id.button_show_user_details_slide);
    profilePictureView.setProfileId(LoginActivity.user.getID());

    profilePictureView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent infoIntent = new Intent(ScreenSlideActivity.this, UserInfoActivity.class);
            ScreenSlideActivity.this.startActivity(infoIntent);

        }
    });

    /**
     * Get Values
     **/
    Intent inIntent = getIntent();
    setmServiceProviderType(inIntent.getStringExtra("TYPE_EXTRA"));

    if (getmServiceProviderType() != null && getmServiceProviderType().equals("help")) {
        mThread.execute(DynamoDBManagerType.GET_TASKS.toString());
    } else {
        mThread.execute(DynamoDBManagerType.GET_PROVIDER.toString(),
                ServiceProvider.stringToEnum(getmServiceProviderType()).toString());
    }

    /**
     * Set Lower Bar Functions
     */
    ((LinearLayout) findViewById(R.id.button_add_new_location)).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent addNewIntent;
            if (getmServiceProviderType().equals("help")) {
                addNewIntent = new Intent(ScreenSlideActivity.this, AddNewTaskActivity.class);
                ScreenSlideActivity.this.startActivity(addNewIntent);
            } else {
                addNewIntent = new Intent(ScreenSlideActivity.this, AddSPActivity.class);
                ScreenSlideActivity.this.startActivity(addNewIntent);
            }

        }
    });

    // TODO "Rank" button Handler

    LinearLayout rankButton = (LinearLayout) findViewById(R.id.button_rank);
    if (getmServiceProviderType().equals("help")) {
        rankButton.setVisibility(View.INVISIBLE);
    } else {
        rankButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                // TODO Rank Dialog

            }
        });
    }

    LinearLayout editButton = (LinearLayout) findViewById(R.id.button_edit);
    if (getmServiceProviderType().equals("help")) {
        editButton.setVisibility(View.INVISIBLE);
    } else {
        editButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent editIntent = null;
                editIntent = new Intent(ScreenSlideActivity.this, EditActivity.class);
                editIntent.putExtra("SP_NUMBER", mCurr);
                ScreenSlideActivity.this.startActivity(editIntent);

                // TODO - update SP when editing is finished
            }
        });
    }

    // Titles
    TextView titleRank = ((TextView) findViewById(R.id.button_rank_title));
    TextView titleAdd = ((TextView) findViewById(R.id.button_add_new_location_title));
    TextView titleEdit = ((TextView) findViewById(R.id.button_edit_title));

    // Define Font
    Typeface font = Typeface.createFromAsset(getAssets(), "fonts/GOTHIC.TTF");
    titleRank.setTypeface(font);
    titleAdd.setTypeface(font);
    titleEdit.setTypeface(font);

}

From source file:com.gh4a.fragment.RepositoryFragment.java

private void fillData() {
    TextView tvRepoName = (TextView) mContentView.findViewById(R.id.tv_repo_name);
    SpannableStringBuilder repoName = new SpannableStringBuilder();
    repoName.append(mRepository.getOwner().getLogin());
    repoName.append("/");
    repoName.append(mRepository.getName());
    repoName.setSpan(new IntentSpan(tvRepoName.getContext()) {
        @Override/*from   www. j a  v  a 2 s  .c o  m*/
        protected Intent getIntent() {
            return IntentUtils.getUserActivityIntent(getActivity(), mRepository.getOwner());
        }
    }, 0, mRepository.getOwner().getLogin().length(), 0);
    tvRepoName.setText(repoName);
    tvRepoName.setMovementMethod(UiUtils.CHECKING_LINK_METHOD);

    TextView tvParentRepo = (TextView) mContentView.findViewById(R.id.tv_parent);
    if (mRepository.isFork() && mRepository.getParent() != null) {
        Repository parent = mRepository.getParent();
        tvParentRepo.setVisibility(View.VISIBLE);
        tvParentRepo.setText(
                getString(R.string.forked_from, parent.getOwner().getLogin() + "/" + parent.getName()));
        tvParentRepo.setOnClickListener(this);
        tvParentRepo.setTag(parent);
    } else {
        tvParentRepo.setVisibility(View.GONE);
    }

    fillTextView(R.id.tv_desc, 0, mRepository.getDescription());
    fillTextView(R.id.tv_language, R.string.repo_language, mRepository.getLanguage());
    fillTextView(R.id.tv_url, 0, !StringUtils.isBlank(mRepository.getHomepage()) ? mRepository.getHomepage()
            : mRepository.getHtmlUrl());

    mContentView.findViewById(R.id.cell_stargazers).setOnClickListener(this);
    mContentView.findViewById(R.id.cell_forks).setOnClickListener(this);
    mContentView.findViewById(R.id.cell_pull_requests).setOnClickListener(this);
    mContentView.findViewById(R.id.tv_contributors_label).setOnClickListener(this);
    mContentView.findViewById(R.id.other_info).setOnClickListener(this);
    mContentView.findViewById(R.id.tv_releases_label).setOnClickListener(this);

    Permissions permissions = mRepository.getPermissions();
    updateClickableLabel(R.id.tv_collaborators_label, permissions != null && permissions.hasPushAccess());
    updateClickableLabel(R.id.tv_downloads_label, mRepository.isHasDownloads());
    updateClickableLabel(R.id.tv_wiki_label, mRepository.isHasWiki());

    TextView tvStargazersCount = (TextView) mContentView.findViewById(R.id.tv_stargazers_count);
    tvStargazersCount.setText(String.valueOf(mRepository.getWatchers()));

    TextView tvForksCount = (TextView) mContentView.findViewById(R.id.tv_forks_count);
    tvForksCount.setText(String.valueOf(mRepository.getForks()));

    LinearLayout llIssues = (LinearLayout) mContentView.findViewById(R.id.cell_issues);

    if (mRepository.isHasIssues()) {
        llIssues.setVisibility(View.VISIBLE);
        llIssues.setOnClickListener(this);
        // value will be filled when PR count arrives
    } else {
        llIssues.setVisibility(View.GONE);
    }

    mContentView.findViewById(R.id.tv_private)
            .setVisibility(mRepository.isPrivate() ? View.VISIBLE : View.GONE);

}