自定义的微信快速索引电话本

2023-12-04 03:59

本文主要是介绍自定义的微信快速索引电话本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

如下图效果显示的快速索引,下面就开始吧!

https://img-blog.csdn.net/20160211134157116?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

1.先看右侧的快速索引Bar,这是个自定义的View

      

package cn.itcast.zz.quicklyindex.ui;import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;import cn.itcast.zz.quicklyindex.util.Util;/*** 自定义一个快速索引的View* Created by Blue Kid on 2016/2/11.*/
public class QuicklyIndex extends View {private Paint paint;private int mHeight;private int mWidth;public static String[] letters = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",};private float cellWidth;private float cellHeight;public QuicklyIndex(Context context) {this(context, null);}public QuicklyIndex(Context context, AttributeSet attrs) {this(context, attrs, 0);}public QuicklyIndex(Context context, AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);init();}private void init() {paint = new Paint();paint.setAntiAlias(true);paint.setTextSize(36f);paint.setColor(Color.WHITE);paint.setTypeface(Typeface.DEFAULT_BOLD);}@Overrideprotected void onDraw(Canvas canvas) {for (int i = 0; i < letters.length; i++) {String text = letters[i];Rect bounds = new Rect();//new出来一个矩形/*** 0 开始测量的索引* text.length() 结束测量的索引*/paint.getTextBounds(text, 0, text.length(), bounds);//把矩形传给paint 可以得到包裹text的矩形paint.setColor(i == index ? Color.BLACK : Color.WHITE);//判断如果是选中的字母就用黑色的画笔int textHeight = bounds.height();//可以从矩形中拿到文字边框的宽和高int textWidth = bounds.width();float x = mWidth * 1.0f / 2 - textWidth * 1.0f / 2;float y = i * cellHeight + cellHeight * 1.0f / 2 + textHeight * 1.0f / 2;canvas.drawText(letters[i], x, y, paint);}}//进行事件的处理操作@Overridepublic boolean onTouchEvent(MotionEvent event) {switch (event.getAction()) {case MotionEvent.ACTION_DOWN:getTouchedWord(event.getY());break;case MotionEvent.ACTION_MOVE:getTouchedWord(event.getY());break;case MotionEvent.ACTION_UP:index = -1;//UP事件的时候把Index重置-1break;case MotionEvent.ACTION_CANCEL:getTouchedWord(event.getY());break;}invalidate();//调用onDraw()方法重新绘制//自己处理返回truereturn true;}int index = -1;private void getTouchedWord(float y) {int currentIndex = (int) (y / cellHeight);if (currentIndex != index) {String ch = letters[currentIndex];if (letterChangeListener != null) {letterChangeListener.letterChange(ch);}index = currentIndex;}}private onLetterChangeListener letterChangeListener;public void setOnLetterChangeListener(onLetterChangeListener letterChangeListener) {this.letterChangeListener = letterChangeListener;}public interface onLetterChangeListener {void letterChange(String letter);}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {super.onMeasure(widthMeasureSpec, heightMeasureSpec);}//布局大小改变时调用 可以获取控件的宽高@Overrideprotected void onSizeChanged(int w, int h, int oldw, int oldh) {mHeight = getMeasuredHeight();mWidth = getMeasuredWidth();cellWidth = mWidth;//获取单个单元格的宽高cellHeight = mHeight * 1.0f / letters.length;}@Overrideprotected void onLayout(boolean changed, int left, int top, int right, int bottom) {super.onLayout(changed, left, top, right, bottom);}//填充完成时调用 可以进行一些findViewById()操作@Overrideprotected void onFinishInflate() {super.onFinishInflate();}
}
2.然后在xml中应用自定义的view

<?xml version="1.0" encoding="utf-8"?>
<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"tools:context=".MainActivity"><ListViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:id="@+id/lv"></ListView><cn.itcast.zz.quicklyindex.ui.QuicklyIndexandroid:layout_width="30dp"android:layout_height="match_parent"android:layout_alignParentRight="true"android:background="#f00"android:id="@+id/quickly"/>
</RelativeLayout>

3.把人名转化成拼音的工具类

package cn.itcast.zz.quicklyindex.util;import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;public class PinyinUtil {/*** 根据汉字获取对应的拼音* @param str* @return*/public static String getPinyin(String str) {// 黑马 -> HEIMA// 设置输出配置HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();// 设置大写format.setCaseType(HanyuPinyinCaseType.UPPERCASE);// 设置不需要音调format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);StringBuilder sb = new StringBuilder();// 获取字符数组char[] charArray = str.toCharArray();for (int i = 0; i < charArray.length; i++) {char c = charArray[i];// 如果是空格, 跳过当前的循环if (Character.isWhitespace(c)) {continue;}if (c > 128 || c < -127) {// 可能是汉字try {// 根据字符获取对应的拼音. 黑 -> HEI , 单 -> DAN , SHANString s = PinyinHelper.toHanyuPinyinStringArray(c, format)[0];sb.append(s);} catch (BadHanyuPinyinOutputFormatCombination e) {e.printStackTrace();}} else {// *&$^*@654654LHKHJ// 不需要转换, 直接添加sb.append(c);}}return sb.toString();}
}
上面用到了一个.jar包pinyin4j-2.5.0.jar    下载地址

0

4.MainActivity的代码里面使用自定义的索引view

package cn.itcast.zz.quicklyindex;import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;import java.util.ArrayList;
import java.util.Collections;import cn.itcast.zz.quicklyindex.domain.Cheeses;
import cn.itcast.zz.quicklyindex.domain.GoodMan;
import cn.itcast.zz.quicklyindex.ui.QuicklyIndex;
import cn.itcast.zz.quicklyindex.util.Util;public class MainActivity extends AppCompatActivity {private ListView mListView;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);getSupportActionBar().hide();fillData();init();}private ArrayList<GoodMan> list = new ArrayList<GoodMan>();private void fillData() {for (int i = 0; i < Cheeses.NAMES.length; i++) {list.add(new GoodMan(Cheeses.NAMES[i]));}//集合排序Collections.sort(list);}private void init() {QuicklyIndex quickly = (QuicklyIndex) findViewById(R.id.quickly);mListView = (ListView) findViewById(R.id.lv);mListView.setAdapter(new MyAdapter());//调用快速查询Bar的接口回调quickly.setOnLetterChangeListener(new QuicklyIndex.onLetterChangeListener() {@Overridepublic void letterChange(String letter) {Util.createToast(MainActivity.this, letter);for(int i=0;i<list.size();i++){if(TextUtils.equals(list.get(i).getPinyin().charAt(0)+"",letter)){mListView.setSelection(i);break;}}}});}class MyAdapter extends BaseAdapter {@Overridepublic int getCount() {return list.size();}@Overridepublic Object getItem(int position) {return null;}@Overridepublic long getItemId(int position) {return 0;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {if (convertView == null) {convertView = getLayoutInflater().from(MainActivity.this).inflate(R.layout.name_item, null);}ViewHolder holder = ViewHolder.getHolder(convertView);GoodMan man=list.get(position);holder.tv_letter.setText(man.getPinyin().charAt(0)+"");holder.tv_name.setText(man.getName());holder.tv_name.setTextColor(Color.BLACK);holder.tv_name.setTextSize(16);if(position==0){holder.first_Header.setVisibility(View.VISIBLE);}else{if(list.get(position-1).getPinyin().charAt(0)==man.getPinyin().charAt(0)){holder.first_Header.setVisibility(View.GONE);}else{holder.first_Header.setVisibility(View.VISIBLE);}}return convertView;}}//ViewHolder类static class ViewHolder {private TextView tv_letter;private TextView tv_name;private LinearLayout first_Header;public static ViewHolder getHolder(View view) {ViewHolder mViewHolder = (ViewHolder) view.getTag();if (mViewHolder == null) {mViewHolder = new ViewHolder();mViewHolder.tv_letter = (TextView) view.findViewById(R.id.tv_letter);mViewHolder.tv_name = (TextView) view.findViewById(R.id.tv_name);mViewHolder.first_Header= (LinearLayout) view.findViewById(R.id.firstLetter);view.setTag(mViewHolder);}return mViewHolder;}}
}

5.LIstView里面用到的数据需要排好序才行,可以调用Collections.sort()方法,但是需要list集合中的对象实现comparable接口

package cn.itcast.zz.quicklyindex.domain;import cn.itcast.zz.quicklyindex.util.PinyinUtil;/*** Created by Blue Kid on 2016/2/11.*/
public class GoodMan implements Comparable<GoodMan>{private String name;private String pinyin;public GoodMan(String name) {this.name = name;pinyin= PinyinUtil.getPinyin(name);}public String getName() {return name;}public String getPinyin() {return pinyin;}@Overridepublic int compareTo(GoodMan another) {return pinyin.compareTo(another.pinyin);}
}

6.ListView条目的布局

<?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"><LinearLayoutandroid:id="@+id/firstLetter"android:layout_width="match_parent"android:layout_height="30dp"android:background="#aaa"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_letter"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:padding="5dp"android:text="A"android:textSize="16sp" /></LinearLayout><TextViewandroid:id="@+id/tv_name"android:layout_width="match_parent"android:layout_height="40dp"android:gravity="center_vertical"android:textColor="@android:color/white" />
</LinearLayout>

还有一个用到的数据

/** Copyright (C) 2010 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**      http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package cn.itcast.zz.quicklyindex.domain;public class Cheeses {public static final String[] sCheeseStrings = {"Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi","Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale","Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese","Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell","Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc","Asadero", "Asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss","Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "Bandal", "Banon","Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase","Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese","Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy","Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille","Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore","Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)","Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves","Boulette d'Avesnes", "Boursault", "Boursin", "Bouyssou", "Bra", "Braudostur","Breakfast Cheese", "Brebis du Lavort", "Brebis du Lochois", "Brebis du Puyfaucon","Bresse Bleu", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin","Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)","Briquette de Brebis", "Briquette du Forez", "Broccio", "Broccio Demi-Affine","Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza","Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)","Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta","Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie","Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat","Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano","Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain","Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou","Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar","Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Chontaleno","Civray", "Coeur de Camembert au Calvados", "Coeur de Chevre", "Colby", "Cold Pack","Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper","Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)","Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese","Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza","Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley","Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino","Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina","Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby","Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin","Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester","Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue","Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz","Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich","Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue","Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle","Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia","Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis","Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus","Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison","Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois","Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse","Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese","Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "Galette Lyonnaise","Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra","Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola","Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost","Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel","Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve","Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi","Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti","Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve","Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster","Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg","Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa","Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine","Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese","Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere","La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire","Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou","Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger","Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings","Livarot", "Llanboidy", "Llanglofan Farmhouse", "Loch Arthur Farmhouse","Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam","Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego","Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin","Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)","Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse","Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda","Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte","Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio","Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne","Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)","Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster","Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel","Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca","Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre","Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty","Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela","Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano","Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage","Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry","Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid","Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Penbryn","Pencarreg", "Perail de Brebis", "Petit Morin", "Petit Pardou", "Petit-Suisse","Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin","Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin","Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre","Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone","Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark","Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit","Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia","Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)","Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna","Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera","Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou","Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder","Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort","Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr","Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin","Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre","Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss","Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela","Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda","Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain","Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese","Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale","Sweet Style Swiss", "Swiss", "Syrian (Armenian String)", "Tala", "Taleggio", "Tamie","Tasmania Highland Chevre Log", "Taupiniere", "Teifi", "Telemea", "Testouri","Tete de Moine", "Tetilla", "Texas Goat Cheese", "Tibet", "Tillamook Cheddar","Tilsit", "Timboon Brie", "Toma", "Tomme Brulee", "Tomme d'Abondance","Tomme de Chevre", "Tomme de Romans", "Tomme de Savoie", "Tomme des Chouans", "Tommes","Torta del Casar", "Toscanello", "Touree de L'Aubier", "Tourmalet","Trappe (Veritable)", "Trois Cornes De Vendee", "Tronchon", "Trou du Cru", "Truffe","Tupi", "Turunmaa", "Tymsboro", "Tyn Grug", "Tyning", "Ubriaco", "Ulloa","Vacherin-Fribourgeois", "Valencay", "Vasterbottenost", "Venaco", "Vendomois","Vieux Corse", "Vignotte", "Vulscombe", "Waimata Farmhouse Blue","Washed Rind Cheese (Australian)", "Waterloo", "Weichkaese", "Wellington","Wensleydale", "White Stilton", "Whitestone Farmhouse", "Wigmore", "Woodside Cabecou","Xanadu", "Xynotyro", "Yarg Cornish", "Yarra Valley Pyramid", "Yorkshire Blue","Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano"};public static final String[] NAMES = new String[] { "宋江", "卢俊义", "吴用","公孙胜", "关胜", "林冲", "秦明", "呼延灼", "花荣", "柴进", "李应", "朱仝", "鲁智深","武松", "董平", "张清", "杨志", "徐宁", "索超", "戴宗", "刘唐", "李逵", "史进", "穆弘","雷横", "李俊", "阮小二", "张横", "阮小五", " 张顺", "阮小七", "杨雄", "石秀", "解珍"," 解宝", "燕青", "朱武", "黄信", "孙立", "宣赞", "郝思文", "韩滔", "彭玘", "单廷珪","魏定国", "萧让", "裴宣", "欧鹏", "邓飞", " 燕顺", "杨林", "凌振", "蒋敬", "吕方","郭 盛", "安道全", "皇甫端", "王英", "扈三娘", "鲍旭", "樊瑞", "孔明", "孔亮", "项充","李衮", "金大坚", "马麟", "童威", "童猛", "孟康", "侯健", "陈达", "杨春", "郑天寿","陶宗旺", "宋清", "乐和", "龚旺", "丁得孙", "穆春", "曹正", "宋万", "杜迁", "薛永", "施恩","周通", "李忠", "杜兴", "汤隆", "邹渊", "邹润", "朱富", "朱贵", "蔡福", "蔡庆", "李立","李云", "焦挺", "石勇", "孙新", "顾大嫂", "张青", "孙二娘", " 王定六", "郁保四", "白胜","时迁", "段景柱" };}

一个单例的吐司也是非常好用的

package cn.itcast.zz.tencentqq.util;import android.content.Context;
import android.widget.Toast;/*** Created by Blue Kid on 2016/2/10.*/
public class Util {private static Toast toast;public static void createToast(Context ctx,String msg){if(toast==null){toast = Toast.makeText(ctx, msg, Toast.LENGTH_SHORT);}else{toast.setText(msg);}toast.show();}
}


这篇关于自定义的微信快速索引电话本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:https://blog.csdn.net/B1ueKid/article/details/50651244
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/452025

相关文章

CSS自定义浏览器滚动条样式完整代码

《CSS自定义浏览器滚动条样式完整代码》:本文主要介绍了如何使用CSS自定义浏览器滚动条的样式,包括隐藏滚动条的角落、设置滚动条的基本样式、轨道样式和滑块样式,并提供了完整的CSS代码示例,通过这些技巧,你可以为你的网站添加个性化的滚动条样式,从而提升用户体验,详细内容请阅读本文,希望能对你有所帮助...

Java实现Elasticsearch查询当前索引全部数据的完整代码

《Java实现Elasticsearch查询当前索引全部数据的完整代码》:本文主要介绍如何在Java中实现查询Elasticsearch索引中指定条件下的全部数据,通过设置滚动查询参数(scrol... 目录需求背景通常情况Java 实现查询 Elasticsearch 全部数据写在最后需求背景通常情况下

Pandas中多重索引技巧的实现

《Pandas中多重索引技巧的实现》Pandas中的多重索引功能强大,适用于处理多维数据,本文就来介绍一下多重索引技巧,具有一定的参考价值,感兴趣的可以了解一下... 目录1.多重索引概述2.多重索引的基本操作2.1 选择和切片多重索引2.2 交换层级与重设索引3.多重索引的高级操作3.1 多重索引的分组聚

shell脚本快速检查192.168.1网段ip是否在用的方法

《shell脚本快速检查192.168.1网段ip是否在用的方法》该Shell脚本通过并发ping命令检查192.168.1网段中哪些IP地址正在使用,脚本定义了网络段、超时时间和并行扫描数量,并使用... 目录脚本:检查 192.168.1 网段 IP 是否在用脚本说明使用方法示例输出优化建议总结检查 1

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

Rust中的Option枚举快速入门教程

《Rust中的Option枚举快速入门教程》Rust中的Option枚举用于表示可能不存在的值,提供了多种方法来处理这些值,避免了空指针异常,文章介绍了Option的定义、常见方法、使用场景以及注意事... 目录引言Option介绍Option的常见方法Option使用场景场景一:函数返回可能不存在的值场景

Python中列表的高级索引技巧分享

《Python中列表的高级索引技巧分享》列表是Python中最常用的数据结构之一,它允许你存储多个元素,并且可以通过索引来访问这些元素,本文将带你深入了解Python列表的高级索引技巧,希望对... 目录1.基本索引2.切片3.负数索引切片4.步长5.多维列表6.列表解析7.切片赋值8.删除元素9.反转列表

SpringBoot 自定义消息转换器使用详解

《SpringBoot自定义消息转换器使用详解》本文详细介绍了SpringBoot消息转换器的知识,并通过案例操作演示了如何进行自定义消息转换器的定制开发和使用,感兴趣的朋友一起看看吧... 目录一、前言二、SpringBoot 内容协商介绍2.1 什么是内容协商2.2 内容协商机制深入理解2.2.1 内容

MySQL的索引失效的原因实例及解决方案

《MySQL的索引失效的原因实例及解决方案》这篇文章主要讨论了MySQL索引失效的常见原因及其解决方案,它涵盖了数据类型不匹配、隐式转换、函数或表达式、范围查询、LIKE查询、OR条件、全表扫描、索引... 目录1. 数据类型不匹配2. 隐式转换3. 函数或表达式4. 范围查询之后的列5. like 查询6

PostgreSQL如何查询表结构和索引信息

《PostgreSQL如何查询表结构和索引信息》文章介绍了在PostgreSQL中查询表结构和索引信息的几种方法,包括使用`d`元命令、系统数据字典查询以及使用可视化工具DBeaver... 目录前言使用\d元命令查看表字段信息和索引信息通过系统数据字典查询表结构通过系统数据字典查询索引信息查询所有的表名可