private void initLikeButton(Button button) { if (LoginInfo.hasLoggedIn()) { if (post.isLiked()) { button.setText("Liked!"); button.setTextColor(getResources().getColor(R.color.toogleColor)); } else { button.setText("Like"); button.setTextColor(getResources().getColor(R.color.normalColor)); } } else { button.setVisibility(View.INVISIBLE); button.setEnabled(false); } }
private void initBottomContainer( FrameLayout frameLayout, LayoutInflater layoutInflater, ViewGroup viewGroup) { if (LoginInfo.hasLoggedIn()) { View v = layoutInflater.inflate(R.layout.layout_text_button, null); comment = (EditText) v.findViewById(R.id.text_field); Button button = (Button) v.findViewById(R.id.send_button); button.setText("Send"); button.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { sendComment(); } }); frameLayout.addView(v); } }