Java Code Examples for android.support.v7.app.ActionBar#setLogo()

The following examples show how to use android.support.v7.app.ActionBar#setLogo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoginActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
public void initView(){

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("登录");

    mBtnLogin = (ButtonFlat)this.findViewById(R.id.id_login_activity_btn_login);
    mBtnLogin.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
    mBtnRegister = (ButtonFlat)this.findViewById(R.id.id_login_activity_btn_regist);
    mBtnRegister.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
    mBtnForget = (ButtonFlat)this.findViewById(R.id.id_login_activity_btn_forget);
    mBtnForget.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
    mEtPassword = (MaterialEditText)this.findViewById(R.id.id_login_activity_et_password);
    mEtUsername = (MaterialEditText)this.findViewById(R.id.id_login_activity_et_username);

    mIvQqLogin = (ImageView)this.findViewById(R.id.id_login_activity_iv_qq_login);
    mIvQqLogin.setOnClickListener(this);

    mBtnRegister.setOnClickListener(this);
    mBtnLogin.setOnClickListener(this);
}
 
Example 2
Source File: ActionbarextrasModule.java    From actionbarextras with MIT License 6 votes vote down vote up
/**
 * Hides the logo
 */
private void handleHideLogo(){
	ActionBar actionBar = getActionBar();
	
	if (actionBar == null){
		return;
	}
	
	try {
		actionBar.setLogo(new ColorDrawable(TiRHelper
				.getAndroidResource("color.transparent")));
	} catch (ResourceNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example 3
Source File: WithdrawLogActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.withdraw_log_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_WITHDRAW_LOG:
                    handleGetWithdrawLog(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("提现记录");

    initData();

    getWithdrawlog();

}
 
Example 4
Source File: VideoCallSettingActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.video_call_setting_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_VIDEO_FEE_SETTING:
                    handleGetVideoFeeSetting(msg);
                    break;
                case OkhttpUtil.MESSAGE_SAVE_VIDEO_FEE_SETTING:
                    handleSaveVideoFeeSetting(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("视频聊天");

    initData();
}
 
Example 5
Source File: SearchUserActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_user_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_SEARCH_USER:
                    handleSearchUser(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("搜索");

    initData();

}
 
Example 6
Source File: GetVipActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.get_vip_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_VIP:
                    handleGetVip(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("开通会员");

    initData();

}
 
Example 7
Source File: NewerTaskActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.newer_task_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_CREDIT:
                    handleCredit(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("新手任务");

    initData();
    getCredit();

}
 
Example 8
Source File: ChooseFriendGroupActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.choose_friendgroup_activity_layout);

    friend_id = getIntent().getStringExtra("friend_id");

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_FRIEND_GROUP_NAME_LIST:
                    handleGetFriendGroupNameList(msg);
                    break;
                case OkhttpUtil.MESSAGE_MODIFY_USER_FRIEND_GROUP:
                    handleModifyUserFriendGroup(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("选择分组");

    listView = (ListView)this.findViewById(R.id.id_choose_friendgroup_activity_listview);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            friendgroup_id =  list_friendgroupnameItem.get(position).getId();
            selected_friendgroup_name = list_friendgroupnameItem.get(position).getFriendgroup_name();
            modifyUserFriendGroup();
        }
    });

    getFriendGroupNameList();
}
 
Example 9
Source File: ChooseFriendActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.choose_friend_activity_layout);

    group_id = getIntent().getStringExtra("group_id");
    hx_group_id = getIntent().getStringExtra("hx_group_id");
    owner_username = getIntent().getStringExtra("owner_username");

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_CHOOSE_FRIEND_LIST:
                    handleGetChooseFriendList(msg);
                    break;
                case OkhttpUtil.MESSAGE_INVITE_FRIEND_TO_GROUP:
                    handleInviteFriendToGroup(msg);
                    break;

            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("选择好友");

    initView();

    getChooseFriendList();


}
 
Example 10
Source File: SecondNameActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.second_name_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_MODIFY_SECOND_NAME:
                    handleModifySecondName(msg);
                    break;
            }
        }
    };

    friend_id = getIntent().getStringExtra("friend_id");
    old_second_name = getIntent().getStringExtra("old_second_name");

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("备注");

    et_second_name = (EditText)this.findViewById(R.id.id_second_name_activity_et_second_name);
    et_second_name.setText(old_second_name);
}
 
Example 11
Source File: WithDrawActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.withdraw_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_CREDIT:
                    handleCredit(msg);
                    break;
                case OkhttpUtil.MESSAGE_ADD_WITHDRAW:
                    handleAddWithdraw(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("提现");

    initData();

    getCredit();

}
 
Example 12
Source File: RegistActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.regist_layout);

    phone = getIntent().getStringExtra("phone");
    if (phone == null) phone = "13800138000";

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_REGIST:
                    handleRegist(msg);
                    break;
                case OkhttpUtil.MESSAGE_LOGIN:
                    handleLogin(msg);
                    break;
            }
        }
    };


    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("注册");
    initData();

}
 
Example 13
Source File: ChooseRequestFriendLocationActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.choose_request_friend_location_activity_layout);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("选择好友");

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_FRIEND_NOT_LOCATION_LIST:
                    handleFriendNotLocationList(msg);
                    break;
                case OkhttpUtil.MESSAGE_REQUEST_FRIEND_LOCATION:
                    handleRequestFriendLocation(msg);
                    break;
            }
        }
    };

    initView();

    getFriendNotLocationList();
}
 
Example 14
Source File: GroupMemberActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.group_member_activity_layout);

    group_id = getIntent().getStringExtra("group_id");
    hx_group_id = getIntent().getStringExtra("hx_group_id");

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GROUP_MEMBER_LIST:
                    handleGroupMemberList(msg);
                    break;
                case OkhttpUtil.MESSAGE_KICK_GROUP_MEMBER:
                    handleKickGroupMember(msg);
                    break;
            }
        }
    };


    ActionBar ab = this.getSupportActionBar();
    ab.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle("群成员");

    initData();

    getGroupMember();

}
 
Example 15
Source File: VisitedUserActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.visited_user_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_VISITED_USER_LIST:
                    handleVisitedUserList(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("谁看过我");

    initData();

    getVisitedUserList();


}
 
Example 16
Source File: PostDetailActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.post_detail_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
               case  OkhttpUtil.MESSAGE_POST_DATA:
                   handlePostData(msg);
                   break;
                case OkhttpUtil.MESSAGE_DELETE_POST:
                    handleDeletePost(msg);
                    break;

            }
        }
    };

    post_id = getIntent().getStringExtra("post_id");

    ActionBar ab = this.getSupportActionBar();
    ab.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle("职位详情");

    ininData();

    getPostDetail();
}
 
Example 17
Source File: SignActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sign_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_GET_SIGN:
                    handleSignData(msg);
                    break;
                case OkhttpUtil.MESSAGE_SIGN:
                    handleSign(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("签到");

    initData();

    getSingData();

}
 
Example 18
Source File: AddPostActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add_post_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_ADD_POST:
                    handleAddPost(msg);
                    break;
            }
        }
    };

    recruit_id = getIntent().getStringExtra("recruit_id");

    ActionBar ab = this.getSupportActionBar();
    ab.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle("添加职位");

    btn_submit = (ButtonFlat)this.findViewById(R.id.id_add_post_activity_btn_submit);
    btn_submit.setBackgroundColor(this.getResources().getColor(R.color.colorPrimary));

    et_postname = (MaterialEditText)this.findViewById(R.id.id_add_post_activity_et_postname);
    et_salary = (MaterialEditText)this.findViewById(R.id.id_add_post_activity_et_salary);
    et_requirement = (MaterialEditText)this.findViewById(R.id.id_add_post_activity_et_requirement);
    et_description = (MaterialEditText)this.findViewById(R.id.id_add_post_activity_et_description);

    btn_submit.setOnClickListener(this);

}
 
Example 19
Source File: UserDataActivity.java    From Social with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.user_data_layout);

    friend_id = getIntent().getStringExtra("friend_id");//需要username

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            //super.handleMessage(msg);
            switch (msg.what){
                case OkhttpUtil.MESSAGE_USER_DATA:
                    handleUserData(msg);
                    break;
                case OkhttpUtil.MESSAGE_ADD_FRIEND:
                    handleAddFriend(msg);
                    break;
                case OkhttpUtil.MESSAGE_DELETE_FRIEND:
                    handleDeleteFriend(msg);
                    break;
                case OkhttpUtil.MESSAGE_AUTO_LOGIN:
                    handleAutoLogin(msg);
                    break;
                case OkhttpUtil.MESSAGE_PHOTO_WALL_LIST:
                    handlePhotoWallList(msg);
                    break;
            }

        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("详细信息");

    initData();

    getPhotoWallList();

    getUserData();

}
 
Example 20
Source File: ManageFriendGroupActivity.java    From Social with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.manage_friendgroup_activity_layout);

    handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what){
                case OkhttpUtil.MESSAGE_FRIEND_GROUP_NAME_LIST:
                    handleGetFriendGroupNameList(msg);
                    break;
            }
        }
    };

    ActionBar actionBar = getSupportActionBar();
    actionBar.setLogo(R.mipmap.ic_arrow_back_white_24dp);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("分组管理");

    rv_add_friendgroup = (RippleView)this.findViewById(R.id.id_manage_friendgroup_activity_rv_add_friendgroup);
    rv_add_friendgroup.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
        @Override
        public void onComplete(RippleView rippleView) {
            Intent intent = new Intent(ManageFriendGroupActivity.this,AddFriendGroupActivity.class);
            startActivityForResult(intent,REQUEST_CODE_ADD_FRIEND_GROUP);
        }
    });

    listView = (SwipeMenuListView)this.findViewById(R.id.id_manage_friendgroup_activity_swipmenuListview);

    creator = new SwipeMenuCreator() {
        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem modifyItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            modifyItem.setBackground(new ColorDrawable(Color.rgb(0xC9, 0xC9,
                    0xCE)));
            // set item width
            modifyItem.setWidth(dp2px(90));
            // set item title
            modifyItem.setTitle("修改");
            // set item title fontsize
            modifyItem.setTitleSize(18);
            // set item title font color
            modifyItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(modifyItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xF9,
                    0x3F, 0x25)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_delete);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    //listView.setMenuCreator(creator);
   listView.setOnMenuItemClickListener(this);


    getFriendGroupNameList();
}