Update search in gallery list

This commit is contained in:
seven332 committed 2015-04-25 14:36:13 +08:00
1 parent 10ca8b352c
commit fbeffe53f6
16 files changed
+286 -116

No files matched your search

@@ -68,12 +68,6 @@ public class FloatLabelEditText extends FrameLayout {
init(context, attrs);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public FloatLabelEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context, attrs);
}
private void init(Context context, AttributeSet attrs) {
mLabel = new TextView(context);
addView(mLabel, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
@@ -17,5 +17,5 @@ package com.hippo.widget;
public interface Hotspotable {
public void setHotspot(float x, float y);
void setHotspot(float x, float y);
}
@@ -82,12 +82,16 @@ public class SimpleImageView extends View implements Drawable.Callback {
super.onLayout(changed, left, top, right, bottom);
int width = right - left;
int height = bottom - top;
mDrawable.setBounds(getPaddingLeft(), getPaddingTop(),
width - getPaddingRight(), height - getPaddingBottom());
if (mDrawable != null) {
mDrawable.setBounds(getPaddingLeft(), getPaddingTop(),
width - getPaddingRight(), height - getPaddingBottom());
}
}
@Override
protected void onDraw(Canvas canvas) {
mDrawable.draw(canvas);
if (mDrawable != null) {
mDrawable.draw(canvas);
}
}
}
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* 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
* 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 com.hippo.widget.recyclerview;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import com.hippo.ehviewer.R;
public class MonoRecyclerView extends EasyRecyclerView {
public MonoRecyclerView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public MonoRecyclerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context, attrs);
}
private void init(Context context, AttributeSet attrs) {
final TypedArray a = context
.obtainStyledAttributes(attrs, R.styleable.MonoRecyclerView);
int space = a.getDimensionPixelOffset(R.styleable.MonoRecyclerView_space, 0);
int spaceLeft = a.getDimensionPixelOffset(R.styleable.MonoRecyclerView_spaceLeft, space);
int spaceRight = a.getDimensionPixelOffset(R.styleable.MonoRecyclerView_spaceRight, space);
int spaceTop = a.getDimensionPixelOffset(R.styleable.MonoRecyclerView_spaceTop, space);
int spaceBottom = a.getDimensionPixelOffset(R.styleable.MonoRecyclerView_spaceBottom, space);
a.recycle();
int halfSpace = space / 2;
MarginItemDecoration itemDecoration = new MarginItemDecoration(halfSpace);
addItemDecoration(itemDecoration);
setPadding(spaceLeft - halfSpace, spaceTop - halfSpace,
spaceRight - halfSpace, spaceBottom - space);
setClipChildren(false);
}
}