Commit 44413d1d authored by v.tarantik's avatar v.tarantik

Nasazeni sipky, zatim nefunkcni pro Nexus 7

parent 629e035d
......@@ -6,3 +6,4 @@ gen
bin
*.log
local.properties
project.properties
......@@ -12,4 +12,4 @@
# Project target.
target=android-19
android.library.reference.1=libraries/AndEngine-1.0.0-SNAPSHOT
android.library.reference.1=../AndEngine/AndEngine-GLES2-AnchorCenter
<?xml version="1.0" encoding="utf-8"?>
<!--
Tablexia
Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0" android:toXDelta="60" android:duration="1000"
android:interpolator="@android:anim/linear_interpolator" />
......@@ -40,6 +40,17 @@
android:layout_centerInParent="true"
android:src="@drawable/newuser_newspaper"
android:visibility="gone" />
<cz.nic.tablexia.widget.RatioPositionSizeImageView
android:id="@+id/arrow_newspaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow_newspaper"
android:visibility="visible"
custom:displayRatioType="height"
custom:displaySizeRatio="0.15"
custom:xPositionRatio="0.08"
custom:yPositionRatio="0.45" />
<RelativeLayout
android:id="@+id/newuser_imageview_newspaper_1"
......
......@@ -26,6 +26,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Point;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.Display;
import android.view.LayoutInflater;
......@@ -37,6 +38,7 @@ import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
......@@ -80,6 +82,7 @@ public class AnimationNewUserFragment extends Fragment implements OnTouchListene
private RatioPositionSizeImageView knock1;
private RatioPositionSizeImageView knock2;
private RatioPositionSizeImageView knock3;
private RatioPositionSizeImageView arrowNewspaper;
private RatioPositionTextView topicBeard;
private RatioPositionTextView topicBalloon;
......@@ -90,6 +93,9 @@ public class AnimationNewUserFragment extends Fragment implements OnTouchListene
private float displayRatio;
private Handler handler = new Handler();
private Runnable runnable;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
pageLayout = (ViewGroup) inflater.inflate(NEWUSER_LAYOUT_BALCONY_ID, null);
......@@ -117,6 +123,36 @@ public class AnimationNewUserFragment extends Fragment implements OnTouchListene
knock2 = (RatioPositionSizeImageView) pageLayout.findViewById(R.id.newuser_imageview_knock2);
knock3 = (RatioPositionSizeImageView) pageLayout.findViewById(R.id.newuser_imageview_knock3);
handler.removeCallbacks(runnable);
arrowNewspaper = (RatioPositionSizeImageView) pageLayout.findViewById(R.id.arrow_newspaper);
final Animation slideOn = AnimationUtils.loadAnimation(getActivity(), R.animator.slide_on);
slideOn.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.d("ANIMATION STARTED");
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
Log.d("ANIMATION END");
handler.postDelayed(runnable = new Runnable() {
@Override
public void run() {
arrowNewspaper.startAnimation(slideOn);
}
}, 1500);
}
});
arrowNewspaper.startAnimation(slideOn);
topicBeard = (RatioPositionTextView) pageLayout.findViewById(R.id.newuser_bubble_beard);
topicBalloon = (RatioPositionTextView) pageLayout.findViewById(R.id.newuser_bubble_balloon);
topicMotocycle = (RatioPositionTextView) pageLayout.findViewById(R.id.newuser_bubble_motocycle);
......@@ -312,6 +348,8 @@ public class AnimationNewUserFragment extends Fragment implements OnTouchListene
Log.d("TOUCH", event.getX() + ", " + event.getY());
int pixel = backgroundBitmap.getPixel((int) (event.getX() * ratioX), (int) (event.getY() * ratioY));
if (Color.alpha(pixel) != 255) {
handler.removeCallbacks(runnable);
arrowNewspaper.setVisibility(View.GONE);
Log.d("ALPHA", Integer.toString(Color.alpha(pixel)));
if (!newspaperRotated) {
newspaperView.setVisibility(View.VISIBLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment