Exemplo n.º 1
0
 @Override
 public void setData(Notification data) {
   msg.setText(data.getMsg());
   time.setText(new JTimeTransform(data.getTime()).toString(new RecentDateFormat()));
   unread.setVisibility(data.isRead() ? View.GONE : View.VISIBLE);
   itemView.setOnClickListener(
       v -> {
         switch (data.getType()) {
           case Notification.PLACE_ADD:
           case Notification.PLACE_REFUSE:
           case Notification.PLACE_PASS:
             Intent place = new Intent(itemView.getContext(), PlaceDetailActivity.class);
             place.putExtra("id", Integer.parseInt(data.getLink()));
             itemView.getContext().startActivity(place);
             break;
           case Notification.BLOG_COMMENT:
           case Notification.BLOG_RECOMMENT:
             Intent blog = new Intent(itemView.getContext(), BlogDetailActivity.class);
             blog.putExtra("id", Integer.parseInt(data.getLink()));
             itemView.getContext().startActivity(blog);
             break;
           case Notification.USER_ATTENTION:
             Intent user = new Intent(itemView.getContext(), UserDetailActivity.class);
             user.putExtra("id", Integer.parseInt(data.getLink()));
             itemView.getContext().startActivity(user);
             break;
         }
       });
 }
Exemplo n.º 2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.user_activity_login);
   ButterKnife.inject(this);
   register.setOnClickListener(v -> startActivity(new Intent(this, RegisterActivity.class)));
   login.setOnClickListener(v -> checkInput());
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_password_edit);
   ButterKnife.bind(this);
   back.setOnClickListener(v -> finish());
   edit.setOnClickListener(v -> check());
 }