![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自定义控件
文章平均质量分 57
豫北小蚂蚁
这个作者很懒,什么都没留下…
展开
-
Dialog-自定义记录
1 基础的Theme 用全屏就可以任意处理布局了 <style name="base_dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item n.原创 2021-12-09 16:18:11 · 92 阅读 · 0 评论 -
progressbar自定义颜色
1主要是定义图层 <ProgressBar android:id="@+id/progressBar" style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:layout_width="m...原创 2020-03-27 14:13:06 · 151 阅读 · 0 评论 -
RecycleView自定义滚动条2
1 在RecycleView下添加一个 自定义View监控rv滑动xml<android.support.v7.widget.RecyclerView android:id="@+id/rv_tabs" android:paddingTop="5dp" ...原创 2020-03-20 16:22:03 · 297 阅读 · 0 评论 -
RecycleView自定义滚动条
简陋了 哈哈1 使用style属性<android.support.v7.widget.RecyclerView android:id="@+id/rv_tabs" style="@style/tablerv_style" androi...原创 2020-03-20 14:46:40 · 1997 阅读 · 0 评论 -
RecycleView 动态设置item宽度
1 通过Adapter动态设置public class TableAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public TableAdapter(@Nullable List<String> data) { super(R.layout.item_table,data...原创 2019-11-18 15:31:14 · 4529 阅读 · 0 评论 -
自定义Ratingbar XLHRatingBar 141
介绍原创 2019-11-06 17:39:47 · 116 阅读 · 0 评论 -
底部弹出的DialogFragment(与dialog用法相似,是Fragment) 带输入法软键盘可以将其顶上去
与Dialog的区别在于更加方便的添加布局<style name="DialogTheme" parent="Theme.AppCompat.Dialog"> <!-- 边框 --> <item name="android:windowFrame">@null</item> <!-- 是否浮...原创 2019-10-23 13:48:16 · 1461 阅读 · 0 评论 -
RecycleView定义分割线
1 自定义分割线public class ListViewDecoration extends RecyclerView.ItemDecoration { private Drawable mDrawable; public ListViewDecoration() { mDrawable = ResCompat.getDrawable(App.getIn...原创 2019-10-08 09:52:23 · 91 阅读 · 0 评论 -
展开收起ExpendTextView(可以添加颜色,和点击事件解决展开和普通点击的冲突)
仿githubhttps://github.com/Carbs0126/ExpandableTextView 336start改造具体使用参照git 介绍,这里只是多加了两个功能1 改造后自己的ExpendableTextViewpackage com.zjxnkj.countrysidecommunity.view.TextView;import android.conte...原创 2019-09-26 18:25:54 · 424 阅读 · 0 评论 -
ViewFilper的RecycleView实现轮播切换的Adapter
1 基于滚动条目高度固定(一般循环滚动条目都是简单的高度固定的)实例高度item24 rv 481 Adpater 实现数据量Int最大值public class MainViewFliperAdapter extends RecyclerView.Adapter<MainViewFliperAdapter.MainViewFliperViewHolder> { ...原创 2019-09-26 16:50:33 · 171 阅读 · 0 评论 -
仿qq消息弹出操作窗口删除,撤销等
1https://github.com/shangmingchao/PopupListgit出处 266star2 git Copy的源代码package com.zjxnkj.countrysidecommunity.view;import android.app.Activity;import android.content.Context;import and...原创 2019-09-23 17:16:06 · 186 阅读 · 0 评论 -
TextView设置SpannableString 添加图片和点击事件(仿微信点赞列表)
1 点赞内容添加 /** * 点赞人布局(默认最多显示10个人) * * @param voteUsers */ public void setVoteStr(View llVoteView, TextView tvVoteView, final List<CountrySideInfo.VoteUser> voteUsers) {...原创 2019-09-23 11:51:33 · 1502 阅读 · 0 评论 -
自定义Switch开关
1 效果图2<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_h...原创 2019-09-17 18:06:25 · 283 阅读 · 0 评论 -
自定义Tablayout显示的Tab数量确定tab宽度
通过反射设置tablayout模式为滚动时候的变量最小宽度值更改/** * 设置显示tab数量的Tablayout */public class NumTabLayout extends TabLayout { //notice 有两种设置TabVIew宽度的方式,在这里我们没必要设置app:tabMinWidth这个属性,因为屏幕的宽度是不固定的, // 我们不可能将...原创 2019-09-04 14:58:44 · 1961 阅读 · 0 评论 -
TabLayout添加小红点*****设置ViewPager+fragment后自定义tab
1 效果图2主布局文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" andr...原创 2019-09-04 14:08:53 · 841 阅读 · 1 评论 -
自定义PhotoView
////// Source code recreated from a .class file by IntelliJ IDEA// (powered by Fernflower decompiler)//package com.ycjr.photo;import android.annotation.TargetApi;import android.content.Context...原创 2018-03-23 10:07:21 · 475 阅读 · 0 评论 -
自定义的画画板
//自定义的画画板,需要在代码中添加,与他的父控件大小一样public class TuyaView extends View { private Context context; private Bitmap mBitmap; private Canvas mCanvas; private Path mPath; private Pai...转载 2018-03-21 20:52:01 · 314 阅读 · 0 评论 -
自定义宽高比的ImageView
1 res/values/attrs文件<?xml version="1.0" encoding="utf-8"?><resources> <declare-styleable name="RatioImageView"> <!--宽度是否根据src图片的比例来测量(高度已知)--> &l转载 2018-04-10 22:34:35 · 472 阅读 · 0 评论 -
ViewPager嵌套ViewPager,内层ViewPager
//第一页响应父类的左滑,最后一页响应父类的右滑public class RollViewPager extends ViewPager { public RollViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public...转载 2018-04-30 15:37:11 · 3639 阅读 · 1 评论 -
QQ侧滑删除SwipeLayout
3步骤第一步 SwipLayout代码package itcas.com.myapplication.swipelayout;import android.content.Context;import android.support.v4.view.ViewCompat;import android.support.v4.widget.ViewDragHelper;import andr...转载 2018-05-01 00:26:54 · 318 阅读 · 0 评论 -
CustomImageView(圆角ImagView)
res/values/attrs<declare-styleable name="Theme"> <attr name="customImageViewStyle" format="reference" /></declare-styleable><!-- 自定义圆角ImageView --><declare-转载 2018-04-27 22:28:47 · 321 阅读 · 0 评论 -
移动的Toast
import android.content.Context;import android.graphics.PixelFormat;import android.view.MotionEvent;import android.view.View;import android.view.WindowManager;import android.widget.TextView;impo...原创 2018-07-03 22:34:40 · 177 阅读 · 0 评论 -
ViewPager+Fragment切换不进行销毁界面,(类似转化为hidden/show)(少量Fragment适宜使用)
public class MyFragmentPagerAdapter extends PagerAdapter { private Fragment[] fragments; private FragmentManager manager; public MyFragmentPagerAdapter(FragmentManager fm, Fragment[] f...转载 2019-04-02 22:19:29 · 317 阅读 · 0 评论 -
editText添加字数限制
1 限制200 例子private void initEdit() { etJobTitle.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, i...原创 2019-07-25 09:38:01 · 180 阅读 · 0 评论 -
自定义简洁的网络加载Dialog
超级简单的使用DialogShow.showRoundProcessDialog(this, "加载数据...");。。。DialogShow.closeDialog();效果图1 代码public class DialogShow {//// private static Dialog mDialog;//// private static V...原创 2019-07-22 17:49:06 · 212 阅读 · 0 评论 -
圆角ImageView 11.2k摘录
//圆形头像 11.2k implementation 'de.hdodenhof:circleimageview:2.1.0'1 只有一个类的代码/* * Copyright 2014 - 2016 Henning Dodenhof * * Licensed under the Apache License, Version 2.0 (the "License");...原创 2019-08-16 10:12:45 · 87 阅读 · 0 评论 -
圆角ImageView 2.5k PorterShapeImageView
出处 compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar' 2.5k1 仅摘取圆角ImageView@SuppressWarnings("WeakerAccess")public abstract class PorterImageView extends android.support.v7.widget....原创 2019-08-21 13:41:17 · 255 阅读 · 0 评论 -
自定义底部弹出Dialog//仿输入法
// 实现点击public class MyDialog extends Dialog implements View.OnClickListener// 自定义style , 底部显示 弹出 public DesDialog(Context context) { super(context, R.style.MyDialogStyle); } @Ov...原创 2018-03-17 22:09:39 · 309 阅读 · 0 评论