<commit_before>/*
 * Copyright (c) 2012 <NAME>
 * 
 * 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 client.bluerhino.cn.lib_image.imagebrowse.polites;

import android.content.Context;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.MediaStore;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;

import java.io.InputStream;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

public class GestureImageView extends ImageView {

    public static final String GLOBAL_NS = "http://schemas.android.com/apk/res/android";
    public static final String LOCAL_NS = "http://schemas.polites.com/android";

    private final Semaphore drawLock = new Semaphore(0);
    private Animator animator;

    private Drawable drawable;

    private float x = 0, y = 0;

    private boolean layout = false;

    private float scaleAdjust = 1.0f;
    public GestureImageViewListener defaultImageViewListener = new GestureImageViewListener() {

        @Override
        public void onTouch(float x, float y) {

        }

        @Override
        public void onScale(float scale) {

        }

        @Override
        public void onPosition(float x, float y) {
            /** ��position�ı�ʱ */
            /** position = ͼƬ��ֱ���������View���Ե�ľ��� */
            /** position = view��ˮƽ���� - ͼƬˮƽ���ȵ�һ�� */
            double halfImage = GestureImageView.this.getScaledWidth() / 2.0;
            double viewWidth = GestureImageView.this.getWidth();
            System.out.println(x);
            System.out.println(halfImage + "::" + (viewWidth - halfImage));
            if (x == halfImage || x == (viewWidth - halfImage)) {<commit_msg>remove Log<commit_after>/*
 * Copyright (c) 2012 <NAME>
 * 
 * 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 client.bluerhino.cn.lib_image.imagebrowse.polites;

import android.content.Context;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.MediaStore;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;

import java.io.InputStream;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

public class GestureImageView extends ImageView {

    public static final String GLOBAL_NS = "http://schemas.android.com/apk/res/android";
    public static final String LOCAL_NS = "http://schemas.polites.com/android";

    private final Semaphore drawLock = new Semaphore(0);
    private Animator animator;

    private Drawable drawable;

    private float x = 0, y = 0;

    private boolean layout = false;

    private float scaleAdjust = 1.0f;
    public GestureImageViewListener defaultImageViewListener = new GestureImageViewListener() {

        @Override
        public void onTouch(float x, float y) {

        }

        @Override
        public void onScale(float scale) {

        }

        @Override
        public void onPosition(float x, float y) {
            /** ��position�ı�ʱ */
            /** position = ͼƬ��ֱ���������View���Ե�ľ��� */
            /** position = view��ˮƽ���� - ͼƬˮƽ���ȵ�һ�� */
            double halfImage = GestureImageView.this.getScaledWidth() / 2.0;
            double viewWidth = GestureImageView.this.getWidth();
            if (x == halfImage || x == (viewWidth - halfImage)) {
{'fraction_non_alphanumeric': 0.10373686259244842, 'fraction_numerical': 0.0058388478007006615, 'mean_word_length': 3.4725848563968666, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4159213', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1417, 'n_words': 427}