(四)Android仿微信—仿QQ登陆
- package com.example.imitateqq;
- import android.app.Activity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.os.Handler;
- public class SplashActivity extends Activity {
- private Intent intent;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.splash);
- startMainAvtivity();
- }
- private void startMainAvtivity() {
- new Handler().postDelayed(new Runnable() {
- public void run() {
- intent=new Intent(SplashActivity.this,QQ.class);
- startActivity(intent);
- SplashActivity.this.finish();//结束本Activity
- }
- }, 1000);//设置执行时间
- }
- }
- <? xml version= "1.0" encoding = "utf-8"?>
- < LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android"
- android:layout_width= "match_parent"
- android:layout_height= "match_parent"
- android:orientation= "vertical" >
- < ImageView
- android:layout_width ="match_parent"
- android:layout_height ="match_parent"
- android:scaleType ="matrix"
- android:src ="@drawable/splash" />
- </ LinearLayout>
- < RelativeLayout xmlns:android ="http://schemas.android.com/apk/res/android"
- xmlns:tools= "http://schemas.android.com/tools"
- android:layout_width= "match_parent"
- android:layout_height= "match_parent"
- android:background= "@drawable/login_bg" >
- < ImageView
- android:id ="@+id/loginbutton"
- android:layout_width ="wrap_content"
- android:layout_height ="wrap_content"
- android:layout_centerHorizontal ="true"
- android:layout_marginTop ="50dp"
- android:src ="@drawable/login_pic" />
- <LinearLayout
- android:id ="@+id/input"
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:layout_below ="@id/loginbutton"
- android:layout_marginLeft ="28.0dip"
- android:layout_marginRight ="28.0dip"
- android:background ="@drawable/login_input"
- android:orientation ="vertical" >
- < LinearLayout
- android:layout_width ="fill_parent"
- android:layout_height ="44.0dip"
- android:background ="@drawable/login_input"
- android:gravity ="center_vertical"
- android:orientation ="horizontal" >
- < EditText
- android:id ="@+id/searchEditText"
- android:layout_width ="0dp"
- android:layout_height ="fill_parent"
- android:layout_weight ="1"
- android:background ="@null"
- android:ems ="10"
- android:imeOptions ="actionDone"
- android:singleLine ="true"
- android:textSize ="16sp" >
- < requestFocus />
- </ EditText>
- < Button
- android:id ="@+id/button_clear"
- android:layout_width ="20dip"
- android:layout_height ="20dip"
- android:layout_marginRight ="8dip"
- android:background ="@drawable/login_input_arrow"
- android:visibility ="visible" />
- </ LinearLayout>
- < View
- android:layout_width ="fill_parent"
- android:layout_height ="1.0px"
- android:layout_marginLeft ="1.0px"
- android:layout_marginRight ="1.0px"
- android:background ="#ffc0c3c4" />
- < EditText
- android:id ="@+id/password"
- android:layout_width ="fill_parent"
- android:layout_height ="44.0dip"
- android:background ="#00ffffff"
- android:gravity ="center_vertical"
- android:inputType ="textPassword"
- android:maxLength ="16"
- android:maxLines ="1"
- android:textColor ="#ff1d1d1d"
- android:textColorHint ="#ff666666"
- android:textSize ="16.0sp" />
- </LinearLayout >
- <Button
- android:id ="@+id/buton1"
- android:layout_width ="270dp"
- android:background ="@drawable/chat_send_button_bg"
- android:paddingTop ="5.0dip"
- android:layout_height ="50dp"
- android:layout_marginLeft ="28.0dip"
- android:layout_marginRight ="28.0dip"
- android:layout_marginTop ="12.0dip"
- android:layout_below ="@+id/input"
- android:gravity ="center"
- android:textSize ="20dp"
- android:text = "登录" />
- <RelativeLayout
- android:id ="@+id/relative"
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:layout_alignLeft ="@+id/input"
- android:layout_alignRight ="@+id/input"
- android:layout_below ="@id/buton1" >
- < CheckBox
- android:id ="@+id/auto_save_password"
- android:layout_width ="wrap_content"
- android:layout_height ="wrap_content"
- android:layout_alignParentLeft ="true"
- android:background ="@null"
- android:button ="@null"
- android:checked ="true"
- android:drawableLeft ="@drawable/checkbox_bg1"
- android:drawablePadding ="4.0dip"
- android:text = "记住密码"
- android:textColor ="#ffffffff"
- android:textSize ="12.0sp" />
- < Button
- android:id ="@+id/regist"
- android:layout_width ="wrap_content"
- android:layout_height ="wrap_content"
- android:layout_alignParentRight ="true"
- android:background ="@drawable/login_reg_normal"
- android:clickable ="true"
- android:gravity ="left|center"
- android:paddingLeft ="8.0dip"
- android:paddingRight ="18.0dip"
- android:text = "注册新账号"
- android:textColor ="#ffffffff"
- android:textSize ="12.0sp" />
- </RelativeLayout >
- <LinearLayout
- android:id ="@+id/more_bottom"
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:layout_alignParentBottom ="true"
- android:background ="@drawable/login_moremenu_back"
- android:orientation ="vertical" >
- <RelativeLayout
- android:id ="@+id/input2"
- android:layout_width ="fill_parent"
- android:layout_height ="40dp"
- android:background ="@drawable/login_moremenu_back"
- android:orientation ="vertical" >
- < ImageView
- android:id ="@+id/more_image"
- android:layout_width ="wrap_content"
- android:layout_height ="wrap_content"
- android:layout_centerVertical ="true"
- android:layout_marginRight ="5.0dip"
- android:layout_toLeftOf ="@+id/more_text"
- android:clickable ="false"
- android:src ="@drawable/login_more_up" />
- < TextView
- android:id ="@+id/more_text"
- android:layout_width ="wrap_content"
- android:layout_height ="wrap_content"
- android:layout_centerInParent ="true"
- android:background ="@null"
- android:gravity ="center"
- android:maxLines ="1"
- android:text = "更多登陆选项"
- android:textColor ="#ffc6e6f9"
- android:textSize ="14.0sp" />
- </RelativeLayout >
- <LinearLayout
- android:id ="@+id/morehidebottom"
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:orientation ="vertical"
- android:visibility ="gone" >
- < View
- android:layout_width ="fill_parent"
- android:layout_height ="1.0px"
- android:background ="#ff005484" />
- < View
- android:layout_width ="fill_parent"
- android:layout_height ="1.0px"
- android:background ="#ff0883cb" />
- < LinearLayout
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:layout_marginLeft ="30.0dip"
- android:layout_marginRight ="30.0dip"
- android:layout_marginTop ="12.0dip"
- android:orientation ="horizontal" >
- < CheckBox
- android:id ="@+id/hide_login"
- android:layout_width ="1.0px"
- android:layout_height ="wrap_content"
- android:layout_weight ="2.0"
- android:background ="@null"
- android:button ="@null"
- android:checked ="false"
- android:drawableLeft ="@drawable/checkbox_bg1"
- android:drawablePadding ="4.0dip"
- android:text = "隐身登陆"
- android:textColor ="#ffc6e6f9"
- android:textSize ="12.0sp" />
- < CheckBox
- android:id ="@+id/silence_login"
- android:layout_width ="1.0px"
- android:layout_height ="wrap_content"
- android:layout_weight ="1.0"
- android:background ="@null"
- android:button ="@null"
- android:checked ="false"
- android:drawableLeft ="@drawable/checkbox_bg1"
- android:drawablePadding ="4.0dip"
- android:text = "静音登录"
- android:textColor ="#ffc6e6f9"
- android:textSize ="12.0sp" />
- </ LinearLayout>
- < LinearLayout
- android:layout_width ="fill_parent"
- android:layout_height ="wrap_content"
- android:layout_marginBottom ="18.0dip"
- android:layout_marginLeft ="30.0dip"
- android:layout_marginRight ="30.0dip"
- android:layout_marginTop ="18.0dip"
- android:orientation ="horizontal" >
- < CheckBox
- android:id ="@+id/accept_accounts"
- android:layout_width ="1.0px"
- android:layout_height ="wrap_content"
- android:layout_weight ="2.0"
- android:background ="@null"
- android:button ="@null"
- android:checked ="true"
- android:drawableLeft ="@drawable/checkbox_bg1"
- android:drawablePadding ="4.0dip"
- android:singleLine ="true"
- android:text = "允许手机/电脑同时在心线"
- android:textColor ="#ffc6e6f9"
- android:textSize ="12.0sp" />
- < CheckBox
- android:id ="@+id/accept_troopmsg"
- android:layout_width ="1.0px"
- android:layout_height ="wrap_content"
- android:layout_weight ="1.0"
- android:background ="@null"
- android:button ="@null"
- android:checked ="true"
- android:drawableLeft ="@drawable/checkbox_bg1"
- android:drawablePadding ="4.0dip"
- android:text = "接受群消息"
- android:textColor ="#ffc6e6f9"
- android:textSize ="12.0sp" />
- </ LinearLayout>
- </ LinearLayout>
- </LinearLayout >
- </ RelativeLayout>
- package com.example.imitateqq;
- import android.os.Bundle;
- import android.app.Activity;
- import android.app.Dialog;
- import android.view.Menu;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- import android.widget.ImageView;
- public class QQ extends Activity implements OnClickListener{
- private Button login_Button;
- private View moreHideBottomView,input2;
- private ImageView more_imageView;
- private boolean mShowBottom = false;
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_qq);
- initView();
- }
- private void initView() {
- login_Button=(Button) findViewById(R.id.buton1);
- login_Button.setOnClickListener(this);
- moreHideBottomView=findViewById(R.id.morehidebottom);
- more_imageView=(ImageView) findViewById(R.id.more_image);
- input2=findViewById(R.id.input2);
- input2.setOnClickListener( this);
- }
- public void showBottom(boolean bShow){
- if(bShow){
- moreHideBottomView.setVisibility(View.GONE);
- more_imageView.setImageResource(R.drawable.login_more_up);
- mShowBottom = true;
- }else{
- moreHideBottomView.setVisibility(View.VISIBLE);
- more_imageView.setImageResource(R.drawable.login_more);
- mShowBottom = false;
- }
- }
- public void onClick(View v) {
- switch(v.getId())
- {
- case R.id.input2:
- showBottom(!mShowBottom);
- break;
- case R.id.buton1:
- showRequestDialog();
- break;
- default:
- break;
- }
- }
- private Dialog mDialog = null;
- private void showRequestDialog()
- {
- if (mDialog != null)
- {
- mDialog.dismiss();
- mDialog = null;
- }
- mDialog = DialogFactory.creatRequestDialog(this, "正在验证账号...");
- mDialog.show();
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.activity_qq, menu);
- return true;
- }
- }
(四)Android仿微信—仿QQ登陆相关推荐
- android 加号弹出菜单,Android仿微信、qq点击右上角加号弹出操作框
Android仿微信.qq点击右上角加号弹出操作框,先上图,类似于下图这种,点击加号,会弹出一个对话框,如下图: 微信: 自己实现: 接下来,我们来实现此功能: 其实,实现原理就是,点击"+ ...
- Android自定义弹窗模仿微信,Android仿微信、qq点击右上角加号弹出操作框
Android仿微信.qq点击右上角加号弹出操作框,先上图,类似于下图这种,点击加号,会弹出一个对话框,如下图: 微信: 自己实现: 接下来,我们来实现此功能: 其实,实现原理就是,点击"+ ...
- android 仿qq群头像,Android仿微信和QQ多图合并框架(类似群头像)的实现方法
Android仿微信和QQ多图合并框架(类似群头像)的实现方法 发布时间:2020-10-21 10:33:03 来源:脚本之家 阅读:97 作者:jyb_96 前言 现在多数app里面加入聊天已经是 ...
- 聊天气泡框模块源码 (高仿微信、QQ聊天的气泡聊天框)
模块名称:聊天气泡框 (易语言模块) 模块作者:邓学彬(泪闯天涯) 模块说明:高仿微信.QQ聊天的气泡聊天框 模块发布:模块+模块源码+调用例程 实现方法:基于列表框(ListBox)控件,自己计算每 ...
- Android 11 微信,QQ ,微博 分享适配
Android 11 微信,QQ ,微博 分享适配 前言 微信篇 QQ篇 微博篇 前言 最近收到客服反馈 有用户反馈微信分享不了,具体询问一番发现是Android 11的小米机器,然后依次试了 QQ ...
- Android仿微信,QQ群头像合成
原文地址:https://www.jb51.net/article/130296.htm 效果图: 作为程序员,首先会评估下工作量吧.在产品眼里,就是把图片合成一起嘛,有啥难度吗?所以工作时间决定了你 ...
- 仿微信,qq组合头像
参考原文:点击打开链接 从网上找了一些仿微信群聊头像demo,发现是studio编写的,我一直习惯用eclpise,所以参考着完成了eclipse版的, 这个界面是写在适配器里面嵌套的,用法和平时一样 ...
- Android 实现微信,QQ的程序前后台切换:back键切换后台;点击通知栏恢复前台。
实现类似微信,QQ的前后台切换:back键切换后台:点击通知栏恢复前台. 1.back键切换后台的实现: 这个实现需要在主activity重写onbackpressed()方法.代码如下: @Over ...
- Android 接收微信、QQ其他应用打开,第三方分享
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 在AndroidManifest.xml注册ACTION事件 <activityandroid:name="com.tes ...
- Android友盟集成QQ登陆详解大全
第一步打开友盟官网注册一个账号,登录如下图进行操作点击个人中心 进入下一个界面点击管理创建一个应用生成AppKey:如下图 返回首页点击SDK与文档点击进行第三方登录集成点击右边的SDK下载选择你需要 ...
最新文章
- 如何看懂一个深度学习的项目代码
- lsof 查看一个进程打开哪些fd及对应的文件或套接字操作
- 神经网络结构与输出值之间的关系
- 声学多普勒流速剖面仪_雷达流量计/流速仪厂家有哪些?
- 提高国内访问GitHub速度的9种方案~
- [react-router] React-Router怎么获取历史对象?
- 【HDU - 6016】Count the Sheep (思维,类似二分图)
- windows 下安装rabbitmq
- python文本文件不能用二进制文件方式读入_如何使用python函数以二进制形式读取文件?...
- linux搭建web服务器原理,【LINUX】linux搭建web服务器
- [学习笔记]Javascript可选的分号
- rhel6下,mysql 5.6.14 主从复制(也称mysql AB复制)环境配置[基于binlog]
- HTTP协议和HTTPS协议
- Jenkins学习一:Jenkins是什么?
- tiobe编程语言排名_排名前20位的编程语言:GitHut和Tiobe排名
- AndroidQQ登录
- 优雅使用Jsdelivr/CDN加速博客访问速度
- 计算机毕业设计ssm+vue基本微信小程序的“香草屋”饮料奶茶点单小程序
- 如何让笔记本电脑更省电
- NeoVim/SpaceVim初体验
热门文章
- android 关于px转化为dp,sp
- openwrt配置内核驱动_OpenWrt添加驱动模块
- 在电脑上剪辑视频用什么软件 如何在电脑上剪辑视频
- 使用lua配置neovim所需的一切
- hdmi tv 的edid_HDMI之EDID分析
- KTV 歌房如何实现伴奏与人声同步功能
- char int word long的大小
- 小程序全局拖动悬浮球插件
- 原生 js、javaScript 处理十位数(带有小数点的浮点数时间戳)、十三位数、时间戳, 将时间戳转换成 年、月、日、时、分、秒、毫秒、正常的日期格式
- 3D游戏之父--John Carmack连载系列(四)