qq下方图标

来源:互联网 发布:我的世界手机java版 编辑:程序博客网 时间:2024/04/30 13:22
/build.gradleallprojects {    repositories {        ...        maven { url 'https://jitpack.io' }    }}/app/build.gradledependencies {    compile 'com.github.XingdongYu:QQNaviView:v1.0.1'}布局: <com.robog.library.QQNaviView        android:id="@+id/qq_view_bubble"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:gravity="center"        app:bigIconSrc="@drawable/pre_bubble_big"        app:smallIconSrc="@drawable/pre_bubble_small"        app:iconWidth="50dp"        app:iconHeight="50dp"        app:range="1.2">        <TextView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:textSize="12sp"            android:text="消息"/>    </com.robog.library.QQNaviView>    <TextView        android:layout_marginTop="100dp"        android:id="@+id/tv"        android:text="水晶湖郡"        android:layout_width="wrap_content"        android:layout_height="wrap_content" />】在activity中: @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        mBubbleView = (QQNaviView) findViewById(R.id.qq_view_bubble);        tv = (TextView) findViewById(R.id.tv);        mBubbleView.setBigIcon(R.drawable.bubble_big);        mBubbleView.setSmallIcon(R.drawable.bubble_small);        mBubbleView.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mBubbleView.setBigIcon(R.drawable.bubble_big);                mBubbleView.setSmallIcon(R.drawable.bubble_small);            }        });        tv.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mBubbleView.setBigIcon(R.drawable.pre_bubble_big);                mBubbleView.setSmallIcon(R.drawable.pre_bubble_small);            }        });    }
原创粉丝点击