package org.softeg.slartus.forpdaplus.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.view.animation.AccelerateInterpolator;

import com.plattysoft.leonids.ParticleSystem;

import org.softeg.slartus.forpdaplus.R;

import java.util.Locale;

/**
 * Created by isanechek on 28.12.16.
 */

public class NewYear extends Activity {

    public static void check(Context ctx) {
        Intent intent = new Intent(ctx, NewYear.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        ctx.startActivity(intent);

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_yaer);

    }


    @Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        new ParticleSystem(this, 80, R.drawable.confeti2, 10000)
                .setSpeedModuleAndAngleRange(0f, 0.1f, 180, 180)
                .setRotationSpeed(144)
                .setAcceleration(0.000017f, 90)
                .emit(findViewById(R.id.emiter_top_right), 8);

        new ParticleSystem(this, 80, R.drawable.confeti3, 10000)
                .setSpeedModuleAndAngleRange(0f, 0.1f, 0, 0)
                .setRotationSpeed(144)
                .setAcceleration(0.000017f, 90)
                .emit(findViewById(R.id.emiter_top_left), 8);



//        new ParticleSystem(this, 100, R.drawable.star_white_border, 800)
//                .setScaleRange(0.7f, 1.3f)
//                .setSpeedRange(0.1f, 0.25f)
//                .setAcceleration(0.0001f, 90)
//                .setRotationSpeedRange(90, 180)
//                .setFadeOut(200, new AccelerateInterpolator())
//                .oneShot(findViewById(R.id.tv_ny), 100);
    }



    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}

@@ -42,16 +42,56 @@
 ivity;%0A%0A
+import android.annotation.SuppressLint;%0A
 import a
@@ -111,16 +111,16 @@
 tivity;%0A
-
 import a
@@ -204,35 +204,8 @@
 le;%0A
-import android.os.Handler;%0A
 impo
@@ -247,62 +247,8 @@
 ble;
-%0Aimport android.view.animation.AccelerateInterpolator;
 %0A%0Aim
@@ -349,18 +349,84 @@
 ava.
-util.Local
+text.ParseException;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Dat
 e;%0A%0A
@@ -552,24 +552,56 @@
 text ctx) %7B%0A
+%0A        if (checkDate()) %7B%0A    
         Inte
@@ -652,16 +652,20 @@
         
+ 
+   
 intent.s
@@ -713,16 +713,20 @@
         
+   
+ 
 ctx.star
@@ -744,16 +744,28 @@
 ntent);%0A
+        %7D%0A%0A%0A
 %0A    %7D%0A%0A
@@ -2024,24 +2024,563 @@
 00);%0A    %7D%0A%0A
+%0A    private static boolean checkDate() %7B%0A%0A        // %D0%9D%D0%B0%D0%B4%D0%BE %D1%82%D0%B5%D1%81%D1%82%D0%B8%D1%82%D1%8C%0A%0A        String startDate = %221/1/2017%22;%0A        @SuppressLint(%22SimpleDateFormat%22) SimpleDateFormat sdf = new SimpleDateFormat(%22dd/MM/yyyy%22);%0A        Date strDate = null;%0A        try %7B%0A            strDate = sdf.parse(startDate);%0A            if (System.currentTimeMillis() %3E= strDate.getTime()) %7B%0A                return true;%0A            %7D%0A        %7D catch (ParseException e) %7B%0A            e.printStackTrace();%0A            return false;%0A        %7D%0A%0A        return false;%0A    %7D
 %0A%0A    @Overr

check date