posts - 93,  comments - 2,  trackbacks - 0
          abc
          <LinearLayout
                     android:id="@+id/estate_linear"
                     android:layout_width="fill_parent"
                     android:layout_height="35dp"
                     android:layout_weight="1"
                     android:background="@drawable/border_rounded_gray_white"
                     android:layout_gravity="center_vertical"
                     android:gravity="center_vertical"
                     android:layout_margin="5dp"
                     android:orientation="horizontal" >
          <ImageButton
                     android:id="@+id/object_btn_search"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="8dp"
                     android:layout_gravity="center_vertical|right"
                     android:background="@drawable/btn_search"
                     android:contentDescription="@null"
                     android:scaleType="fitXY" />
          <RelativeLayout
                      android:layout_width="1dp"
                      android:layout_height="33dp"
                      android:layout_marginLeft="8dp"
                      android:background="@color/color_line" />
                      <EditText
                           android:id="@+id/object_et_content"
                           style="@style/StringSearchText"
                           android:layout_gravity="left|center_vertical"
                           android:layout_marginLeft="2dp"
                           android:layout_marginRight="8dp"
                           android:layout_weight="1"
                           android:background="@null"
                           android:hint="@string/tip_search_hint"
                           android:imeOptions="actionSend"
                           android:singleLine="true"
                           android:textCursorDrawable="@null"
                           android:textColorHint="#626463" />
                      <ImageButton
                           android:id="@+id/object_btn_del"
                           android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
                           android:layout_gravity="right|center_vertical"
                           android:layout_marginRight="10dp"
                           android:background="@drawable/ic_clear" />
                   </LinearLayout>


          border_rounded_gray_white.xml
          <?xml version="1.0" encoding="utf-8"?>
          <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
              <!-- 連框顏色值 -->
              <item>
                  <shape>
                      <solid android:color="@color/bg_gray" />
                      <corners
                          android:bottomLeftRadius="3dp"
                          android:bottomRightRadius="3dp"
                          android:topLeftRadius="3dp"
                          android:topRightRadius="3dp" />
                  </shape>
              </item>
              <!-- 主體背景顏色值 -->
              <item
                  android:bottom="1dp"
                  android:left="1dp"
                  android:right="1dp"
                  android:top="1dp">
                  <shape>
                      <solid android:color="@color/white" />
                      <corners
                          android:bottomLeftRadius="3dp"
                          android:bottomRightRadius="3dp"
                          android:topLeftRadius="3dp"
                          android:topRightRadius="3dp" />
                  </shape>
              </item>
          </layer-list>

          <style name="StringSearchText">
                  <item name="android:textSize">14dp</item>
                  <item name="android:layout_width">wrap_content</item>
                  <item name="android:layout_height">wrap_content</item>
                  <item name="android:textColor">@android:color/black</item>
              </style>

          btn_search.xml
          <?xml version="1.0" encoding="utf-8"?>
          <selector xmlns:android="http://schemas.android.com/apk/res/android">
              <!-- 沒有焦點時的背景圖片 -->
              <item android:drawable="@drawable/ic_search_normal" android:state_window_focused="false"/>
              <!-- 非觸摸模式下獲得焦點并單擊時的背景圖片 -->
              <item android:drawable="@drawable/ic_search_pressed" android:state_focused="true" android:state_pressed="true"/>
              <!-- 觸摸模式下單擊時的背景圖片 -->
              <item android:drawable="@drawable/ic_search_pressed" android:state_focused="false" android:state_pressed="true"/>
              <!-- 選中時的圖片背景 -->
              <item android:drawable="@drawable/ic_search_pressed" android:state_selected="true"/>
              <!-- 獲得焦點時的圖片背景 -->
              <item android:drawable="@drawable/ic_search_pressed" android:state_focused="true"/>
              <!-- 默認(rèn)圖片背景 -->
              <item android:drawable="@drawable/ic_search_normal"/>
          </selector>

          <color name="color_line">#bebebe</color>



          private TextWatcher textWatcher = new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count,
          int after) {
          }
          @Override
          public void onTextChanged(CharSequence s, int start, int before,
          int count) {
          }
          @Override
          public void afterTextChanged(Editable s) {
          mKeywords = tv_keyword.getText().toString();
          AgUtils.log(TAG+"mKeywords:"+mKeywords, 4);
          if (TextUtils.isEmpty(mKeywords)) {
          object_btn_del.setVisibility(View.GONE);
          } else {
          object_btn_del.setVisibility(View.VISIBLE);
          searchIndexListInfo();
          }
          }
          };

          tv_keyword.addTextChangedListener(textWatcher);
          posted on 2015-07-08 23:55 Terry Zou 閱讀(141) 評論(0)  編輯  收藏 所屬分類: Android
          <2015年7月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          收藏夾

          Java

          搜索

          •  

          最新隨筆

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 抚宁县| 中卫市| 北京市| 阳西县| 横峰县| 科技| 汶上县| 梅州市| 类乌齐县| 宜良县| 万全县| 如皋市| 连城县| 江津市| 临海市| 大田县| 宁津县| 莱芜市| 农安县| 巴中市| 隆安县| 军事| 安义县| 碌曲县| 永福县| 高雄市| 贡嘎县| 兰考县| 张掖市| 雷波县| 福州市| 望都县| 福贡县| 库车县| 固原市| 安康市| 屏山县| 乐山市| 甘谷县| 平武县| 万年县|