List of usage examples for android.view View INVISIBLE
int INVISIBLE
To view the source code for android.view View INVISIBLE.
Click Source Link
From source file:com.pseudosudostudios.jdd.views.Grid.java
/** * Prompts the user and calls loadGame() *//* www. j a va 2 s.co m*/ public void makeNewGame() { hasUsed = false; if (tiles != null) for (Tile[] row : tiles) for (Tile t : row) t.setVisibility(View.INVISIBLE); AlertDialog.Builder build = new AlertDialog.Builder(getContext()); build.setTitle("How many colors?").setCancelable(false); View myView = ((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)) .inflate(R.layout.number_colors_input, null); final EditText input = (EditText) myView.findViewById(R.id.colorInputET); final RadioButton easy = (RadioButton) myView.findViewById(R.id.easyRB); final RadioButton medium = (RadioButton) myView.findViewById(R.id.mediumRB); final RadioButton hard = (RadioButton) myView.findViewById(R.id.hardRB); build.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { try { Grid.numberOfColors = Integer.parseInt(input.getText().toString()); if (numberOfColors < 2) { numberOfColors = 2; Toast.makeText(getContext(), getContext().getString(R.string.too_few_colors), Toast.LENGTH_SHORT).show(); } if (numberOfColors > TileFactory.colors.length) numberOfColors = TileFactory.colors.length; } catch (NumberFormatException e) { Grid.numberOfColors = 6; } if (easy.isChecked()) setDifficulty(Difficulty.EASY); if (medium.isChecked()) setDifficulty(Difficulty.MEDIUM); if (hard.isChecked()) setDifficulty(Difficulty.HARD); Tile.initPaints(); loadNewGame(); invalidate(); // let it draw! } }).setView(myView).show(); }
From source file:com.scigames.slidegame.ObjectiveActivity.java
/** Called with the activity is first created. */ @Override//w w w .ja va 2 s. c o m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Log.d(TAG, "super.OnCreate"); Intent i = getIntent(); Log.d(TAG, "getIntent"); rfidIn = i.getStringExtra("rfid"); studentIdIn = i.getStringExtra("studentId"); slideLevelIn = i.getStringExtra("slideLevel"); // photoUrl = i.getStringExtra("photo"); // photoUrl = "http://db.scigam.es/" + photoUrl; Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.objective_page); Log.d(TAG, "...setContentView"); objectiveImgNum = 0; //resultImg[0] = "http://db.scigam.es/narrative_images/Level0/results/_0012_Layer-Comp-13.png"; //resultImg[1] = "http://db.scigam.es/narrative_images/Level0/results/_0012_Layer-Comp-13.png"; alertDialog = new AlertDialog.Builder(ObjectiveActivity.this).create(); alertDialog.setTitle("No Registration System Attached "); alertDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show(); finish(); } }); infoDialog = new AlertDialog.Builder(ObjectiveActivity.this).create(); infoDialog.setTitle("Debug Info"); infoDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed //Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show(); } }); needSlideDataDialog = new AlertDialog.Builder(ObjectiveActivity.this).create(); needSlideDataDialog.setTitle("Debug Info"); needSlideDataDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed //Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show(); Intent i = new Intent(ObjectiveActivity.this, LoginActivity.class); Log.d(TAG, "new LoginActivity Intent"); i.putExtra("page", "login"); Log.d(TAG, "startActivity..."); ObjectiveActivity.this.startActivity(i); Log.d(TAG, "...startActivity"); } }); ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf"); Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf"); Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf"); Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf"); reviewBtnNext = (Button) findViewById(R.id.btn_next); reviewBtnNext.setOnClickListener(mNext); reviewBtnNext.setVisibility(View.INVISIBLE); reviewBtnBack = (Button) findViewById(R.id.btn_back); reviewBtnBack.setOnClickListener(mBack); reviewBtnBack.setVisibility(View.INVISIBLE); btnContinue = (Button) findViewById(R.id.btn_continue); btnContinue.setOnClickListener(mContinue); getObjectiveImages(slideLevelIn); //level 0 : 50 kin, 50 therm //level 1 : 60 kin, 40 therm //level 2 : 40 kin, 60 therm //level 3 : 70 kin, 30 therm //level 4 : 30 kin, 70 therm }
From source file:com.privacity.PerfilActivity.java
public void agregarPerfil(View view) { JSONObject jsonObject = com.agregarPerfil(codigo); Dialog dialogo = new Dialog(this); //Tratamiento de errores if (jsonObject.has("Error")) { dialogo.setTitle(getResources().getString(R.string.errorDeConexion)); try {//from w w w . jav a2s.c o m String error = jsonObject.getString("Error"); dialogo.setTitle(error); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } //IF else { //Si ha tenido exito dialogo.setTitle(getResources().getString(R.string.perfilAgregado)); botonAceptar.setVisibility(View.INVISIBLE); botonCancelar.setVisibility(View.VISIBLE); } dialogo.show(); }
From source file:cc.softwarefactory.lokki.android.activities.SignUpActivity.java
private void toggleLoading(Boolean isLoading) { aq.id(R.id.sign_up_loading).visibility(isLoading ? View.VISIBLE : View.INVISIBLE); aq.id(R.id.sign_up_button).visibility(isLoading ? View.INVISIBLE : View.VISIBLE); }
From source file:com.github.rutvijkumar.twittfuse.TwitterUtil.java
private void doReTweet(final Tweet tweet, final ImageButton rtAction, final TextView rtCount, final boolean hideZero) { client.postRT(String.valueOf(tweet.getUid()), new JsonHttpResponseHandler() { // @Override // public void onSuccess(int statusCode, Header[] headers, // JSONObject response) { // onSuccess(response); // } // @Override // public void onFailure(int statusCode, Header[] headers, // Throwable throwable, JSONObject errorResponse) { // onFailure(throwable, errorResponse); // } @Override//from w w w .j ava 2 s. c om public void onSuccess(JSONObject body) { final long newRTCount = tweet.getReTweetCount() + 1; tweet.setRetweeted(true); tweet.setReTweetCount(newRTCount); tweet.save(); setRTView(true, rtAction); rtCount.setText(String.valueOf(newRTCount)); if (hideZero) { if (newRTCount == 0) { rtCount.setVisibility(View.INVISIBLE); } else { rtCount.setVisibility(View.VISIBLE); } } } public void onFailure(Throwable e, JSONObject error) { Log.d("DEBUG", error.toString()); Log.e("ERROR", "Exception while doing RT", e); } }); }
From source file:com.aibasis.parent.adapter.ChatAllHistoryAdapter.java
@Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(R.layout.row_chat_history, parent, false); }/*from ww w .j a v a2s. co m*/ ViewHolder holder = (ViewHolder) convertView.getTag(); if (holder == null) { holder = new ViewHolder(); holder.name = (TextView) convertView.findViewById(R.id.name); holder.unreadLabel = (TextView) convertView.findViewById(R.id.unread_msg_number); holder.message = (TextView) convertView.findViewById(R.id.message); holder.time = (TextView) convertView.findViewById(R.id.time); holder.avatar = (ImageView) convertView.findViewById(R.id.avatar); holder.msgState = convertView.findViewById(R.id.msg_state); holder.list_item_layout = (RelativeLayout) convertView.findViewById(R.id.list_item_layout); convertView.setTag(holder); } if (position % 2 == 0) { holder.list_item_layout.setBackgroundResource(R.drawable.mm_listitem); } else { holder.list_item_layout.setBackgroundResource(R.drawable.mm_listitem_grey); } // ?/? EMConversation conversation = getItem(position); // ?usernamegroupid String username = conversation.getUserName(); if (conversation.getType() == EMConversationType.GroupChat) { // ???? holder.avatar.setImageResource(R.drawable.group_icon); EMGroup group = EMGroupManager.getInstance().getGroup(username); holder.name.setText(group != null ? group.getGroupName() : username); } else if (conversation.getType() == EMConversationType.ChatRoom) { holder.avatar.setImageResource(R.drawable.group_icon); EMChatRoom room = EMChatManager.getInstance().getChatRoom(username); holder.name.setText(room != null && !TextUtils.isEmpty(room.getName()) ? room.getName() : username); } else { UserUtils.setUserAvatar(getContext(), username, holder.avatar); if (username.equals(Constant.GROUP_USERNAME)) { holder.name.setText("?"); } else if (username.equals(Constant.NEW_FRIENDS_USERNAME)) { holder.name.setText(""); } Map<String, RobotUser> robotMap = ((DemoHXSDKHelper) HXSDKHelper.getInstance()).getRobotList(); if (robotMap != null && robotMap.containsKey(username)) { String nick = robotMap.get(username).getNick(); if (!TextUtils.isEmpty(nick)) { holder.name.setText(nick); } else { holder.name.setText(username); } } else { UserUtils.setUserNick(username, holder.name); } } if (conversation.getUnreadMsgCount() > 0) { // ? holder.unreadLabel.setText(String.valueOf(conversation.getUnreadMsgCount())); holder.unreadLabel.setVisibility(View.VISIBLE); } else { holder.unreadLabel.setVisibility(View.INVISIBLE); } if (conversation.getMsgCount() != 0) { // ???itemmessage EMMessage lastMessage = conversation.getLastMessage(); holder.message.setText( SmileUtils.getSmiledText(getContext(), getMessageDigest(lastMessage, (this.getContext()))), BufferType.SPANNABLE); holder.time.setText(DateUtils.getTimestampString(new Date(lastMessage.getMsgTime()))); if (lastMessage.direct == EMMessage.Direct.SEND && lastMessage.status == EMMessage.Status.FAIL) { holder.msgState.setVisibility(View.VISIBLE); } else { holder.msgState.setVisibility(View.GONE); } } return convertView; }
From source file:com.bellman.bible.android.view.activity.base.ProgressActivityBase.java
protected void hideButtons() { View buttonPanel = findViewById(R.id.button_panel); if (buttonPanel != null) { buttonPanel.setVisibility(View.INVISIBLE); } }
From source file:ac.robinson.ticqr.TicQRActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_send_order: sendOrder();/*from w ww .j a v a2 s . c o m*/ return true; case R.id.action_rescan: // reset our configuration and set up for rescanning mBitmap = null; mDestinationEmail = null; mServerTickBoxes.clear(); mImageTickBoxes.clear(); mBoxesLoaded = false; mImageParsed = false; mEmailContents = null; mImageView.setVisibility(View.INVISIBLE); // must be invisible (not gone) as we need its dimensions RelativeLayout highlightHolder = (RelativeLayout) findViewById(R.id.tick_highlight_holder); highlightHolder.removeAllViews(); getSupportActionBar().setTitle(R.string.title_activity_capture); supportInvalidateOptionsMenu(); requestScanResume(); return true; default: return super.onOptionsItemSelected(item); } }
From source file:com.RSMSA.policeApp.Fragments.PaymentVerifierFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { contentView = (RelativeLayout) inflater.inflate(R.layout.fragment_payment_verifier, container, false); /**/* ww w. j ava 2 s .co m*/ * get the instances of the buttons at our view */ progressBar = (ProgressBar) contentView.findViewById(R.id.pbar_main); inputnformation = (RelativeLayout) contentView.findViewById(R.id.input_information); verificationResults = (ScrollView) contentView.findViewById(R.id.verification_results); driversOffenceList = (LinearLayout) contentView.findViewById(R.id.history_list_driver); vehiclesOffenceList = (LinearLayout) contentView.findViewById(R.id.history_list_car); vehiclesDetails = (LinearLayout) contentView.findViewById(R.id.vehicles_details); driversDetails = (LinearLayout) contentView.findViewById(R.id.drivers_details); nameTextView = (TextView) contentView.findViewById(R.id.name); licenseNumberTextView = (TextView) contentView.findViewById(R.id.license_number); addressTextView = (TextView) contentView.findViewById(R.id.address); genderTextView = (TextView) contentView.findViewById(R.id.gender); dateOfBirthTextView = (TextView) contentView.findViewById(R.id.date_of_birth); phoneNumberTextView = (TextView) contentView.findViewById(R.id.phone_number); makeTextView = (TextView) contentView.findViewById(R.id.make); plateNumberTextView = (TextView) contentView.findViewById(R.id.plate_number); typeTextView = (TextView) contentView.findViewById(R.id.type); colorTextView = (TextView) contentView.findViewById(R.id.color); scanBtn = (ImageView) contentView.findViewById(R.id.scan_button); verifyBtn = (Button) contentView.findViewById(R.id.verify); verifyBtn.setTypeface(MainOffence.Rosario_Bold); licenseEdittext = (EditText) contentView.findViewById(R.id.license_); verifyBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d("MainOffense", "verify button clicked"); licenceNumber = licenseEdittext.getText().toString(); if (licenceNumber.equals("")) { Toast toast = Toast.makeText(getActivity(), " Field Empty!", Toast.LENGTH_SHORT); toast.show(); } else { verifyBtn.setVisibility(View.INVISIBLE); progressBar.setVisibility(View.VISIBLE); progressBar.bringToFront(); NetAsync(view); } } }); final RadioButton licence = (RadioButton) contentView.findViewById(R.id.licence); licence.setTypeface(MainOffence.Roboto_Regular); final RadioButton plate = (RadioButton) contentView.findViewById(R.id.plate); plate.setTypeface(MainOffence.Roboto_Regular); licence.setChecked(true); licence.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (b == true) { driversPaymentVerification = true; licenseEdittext.setHint("Enter Licence No"); } } }); plate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (b == true) { driversPaymentVerification = false; licenseEdittext.setHint("Enter Plate No"); } } }); try { receivedNumber = getArguments().getString("licenceNumber"); } catch (Exception e) { } if (receivedNumber != null) { verifyLicenceNumber(receivedNumber); } else { try { receivedNumber = getArguments().getString("plateNumber"); } catch (Exception e) { } if (!receivedNumber.equals("") || receivedNumber != null) { driversPaymentVerification = false; plate.setChecked(true); licence.setChecked(false); verifyLicenceNumber(receivedNumber); } } return contentView; }
From source file:fm.smart.r1.activity.ItemActivity.java
static void setSound(ImageView sound_icon, final String sound_url, final Context context, final int type_id, final String artifact_id, final String to_record) { if (!TextUtils.isEmpty(sound_url)) { OnClickListener sound_listener = new OnClickListener() { public void onClick(View v) { Main.playSound(sound_url, ItemListActivity.mMediaPlayer, context); }//w ww . ja va2 s. co m }; sound_icon.setOnClickListener(sound_listener); } else { if (type_id == R.id.response_sound || type_id == R.id.translation_sound) { sound_icon.setVisibility(View.INVISIBLE); } else { sound_icon.setImageBitmap( BitmapFactory.decodeResource(context.getResources(), R.drawable.inactive_sound_add)); OnClickListener listener = new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName(context, CreateSoundActivity.class.getName()); Utils.putExtra(intent, "item_id", (String) item.item_node.atts.get("id")); Utils.putExtra(intent, "to_record", to_record); Utils.putExtra(intent, "id", artifact_id); Utils.putExtra(intent, "sound_type", Integer.toString(type_id)); context.startActivity(intent); } }; sound_icon.setOnClickListener(listener); } } }