-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ea3119
commit 4537b39
Showing
50 changed files
with
570 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
MyBlocks | ||
MyIntent | ||
---- | ||
* TODO: description | ||
|
||
* TODO: implement local menu API exactly as options menu API is implemented! (MyFragment) | ||
|
||
* TODO: implement some API for main FAB (so it is easly accessable from MyFragment) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<manifest package="pl.mareklangiewicz.myactivities"></manifest> | ||
<manifest package="pl.mareklangiewicz.myactivities"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<manifest package="pl.mareklangiewicz.mydrawables"></manifest> | ||
<manifest package="pl.mareklangiewicz.mydrawables"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<manifest package="pl.mareklangiewicz.myfragments"></manifest> | ||
<manifest package="pl.mareklangiewicz.myfragments"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...langiewicz/mytestapp/ApplicationTest.java → ...klangiewicz/myintent/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 11 additions & 16 deletions
27
mytestapp/src/main/AndroidManifest.xml → myintent/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="pl.mareklangiewicz.mytestapp" | ||
> | ||
package="pl.mareklangiewicz.myintent"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
<!-- TODO SOMEDAY: automatic backup for user defined RE rules. (to synchronize between marshmallow devices)--> | ||
|
||
<application android:allowBackup="false" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme" | ||
> | ||
android:icon="@mipmap/ic_launcher" | ||
android:supportsRtl="false" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name="pl.mareklangiewicz.myactivities.MyTestActivity" | ||
android:label="@string/title_my_test_activity" | ||
android:name=".MIActivity" | ||
android:label="@string/title_mi_activity" | ||
> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name="pl.mareklangiewicz.myactivities.MyExampleActivity" | ||
android:label="@string/title_my_example_activity" | ||
/> | ||
<activity | ||
android:name="pl.mareklangiewicz.mytestapp.MyExampleActivity2" | ||
android:label="@string/title_my_example_activity_2" | ||
android:name="pl.mareklangiewicz.myactivities.MyTestActivity" | ||
android:label="TMP:MyTestActivity" | ||
/> | ||
|
||
</application> | ||
|
||
</manifest> |
143 changes: 143 additions & 0 deletions
143
myintent/src/main/java/pl/mareklangiewicz/myintent/MIActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
package pl.mareklangiewicz.myintent; | ||
|
||
import android.animation.ObjectAnimator; | ||
import android.animation.PropertyValuesHolder; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.support.annotation.IdRes; | ||
import android.support.annotation.Nullable; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.view.animation.LinearInterpolator; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import pl.mareklangiewicz.myactivities.MyActivity; | ||
import pl.mareklangiewicz.mydrawables.MyLivingDrawable; | ||
import pl.mareklangiewicz.mydrawables.MyMagicLinesDrawable; | ||
import pl.mareklangiewicz.myviews.IMyNavigation; | ||
|
||
/** | ||
* Created by Marek Langiewicz on 02.10.15. | ||
* My Intent main activity. | ||
*/ | ||
public class MIActivity extends MyActivity{ | ||
|
||
private @Nullable MyLivingDrawable mMyMagicLinesDrawable; | ||
private @Nullable View mMagicLinesView; | ||
@SuppressWarnings("unused") | ||
private @Nullable ImageView mLogoImageView; | ||
private @Nullable TextView mLogoTextView; | ||
private @Nullable TextView mHomePageTextView; | ||
private @Nullable ObjectAnimator mLogoTextViewAnimator; | ||
private @Nullable ObjectAnimator mHomePageTextViewAnimator; | ||
private @Nullable ObjectAnimator mMagicLinesDrawableAnimator; | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
log.i("TODO: hello, and where is help.."); | ||
|
||
//noinspection ConstantConditions | ||
getGlobalNavigation().inflateMenu(R.menu.mi_menu); | ||
getGlobalNavigation().inflateHeader(R.layout.mi_header); | ||
|
||
|
||
//noinspection ConstantConditions | ||
mMyMagicLinesDrawable = new MyMagicLinesDrawable(); | ||
mMyMagicLinesDrawable.setColor(0x30ffffff).setStrokeWidth(dp2px(4)); | ||
//noinspection ConstantConditions | ||
mMagicLinesView = getGlobalNavigation().getHeader().findViewById(R.id.magic_underline_view); | ||
mMagicLinesView.setBackground(mMyMagicLinesDrawable); | ||
mLogoImageView = (ImageView) getGlobalNavigation().getHeader().findViewById(R.id.image_logo); | ||
mLogoTextView = (TextView) getGlobalNavigation().getHeader().findViewById(R.id.text_logo); | ||
mHomePageTextView = (TextView) getGlobalNavigation().getHeader().findViewById(R.id.text_home_page); | ||
//noinspection ConstantConditions | ||
mHomePageTextView.setOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onCommand("data " + getResources().getString(R.string.user_id)); | ||
} | ||
}); | ||
|
||
PropertyValuesHolder pvha1 = PropertyValuesHolder.ofFloat(View.ALPHA, 0f, 0.2f, 1f); | ||
PropertyValuesHolder pvhy1 = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, -130f, -30f, 0f); | ||
PropertyValuesHolder pvha2 = PropertyValuesHolder.ofFloat(View.ALPHA, 0f, 0f, 0.7f); | ||
PropertyValuesHolder pvhy2 = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, -50f, -50f, 0f); | ||
|
||
mLogoTextViewAnimator = ObjectAnimator.ofPropertyValuesHolder(mLogoTextView, pvha1, pvhy1); | ||
mHomePageTextViewAnimator = ObjectAnimator.ofPropertyValuesHolder(mHomePageTextView, pvha2, pvhy2); | ||
mLogoTextViewAnimator.setInterpolator(new LinearInterpolator()); | ||
mHomePageTextViewAnimator.setInterpolator(new LinearInterpolator()); | ||
|
||
mMagicLinesDrawableAnimator = ObjectAnimator.ofInt(mMyMagicLinesDrawable, "level", 0, 10000); | ||
mMagicLinesDrawableAnimator.setDuration(1000).setInterpolator(new LinearInterpolator()); | ||
|
||
if(savedInstanceState == null) { | ||
selectGlobalItem(R.id.mi_start); | ||
} | ||
} | ||
|
||
@Override protected void onDestroy() { | ||
|
||
mMagicLinesDrawableAnimator = null; | ||
mHomePageTextViewAnimator = null; | ||
mLogoTextViewAnimator = null; | ||
mHomePageTextView = null; | ||
mLogoTextView = null; | ||
mLogoImageView = null; | ||
mMagicLinesView = null; | ||
mMyMagicLinesDrawable = null; | ||
|
||
super.onDestroy(); | ||
} | ||
|
||
@Override public void onDrawerSlide(View drawerView, float slideOffset) { | ||
super.onDrawerSlide(drawerView, slideOffset); | ||
if(drawerView != mGlobalNavigationView) | ||
return; | ||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { | ||
if(mLogoTextViewAnimator != null) | ||
mLogoTextViewAnimator.setCurrentFraction(slideOffset); | ||
if(mHomePageTextViewAnimator != null) | ||
mHomePageTextViewAnimator.setCurrentFraction(slideOffset); | ||
} | ||
} | ||
|
||
|
||
@Override public void onDrawerOpened(View drawerView) { | ||
super.onDrawerOpened(drawerView); | ||
if(drawerView != mGlobalNavigationView) | ||
return; | ||
if(mMagicLinesDrawableAnimator != null) | ||
if(!mMagicLinesDrawableAnimator.isStarted()) | ||
mMagicLinesDrawableAnimator.start(); | ||
} | ||
|
||
@Override public void onDrawerClosed(View drawerView) { | ||
super.onDrawerClosed(drawerView); | ||
if(drawerView != mGlobalNavigationView) | ||
return; | ||
if(mMagicLinesDrawableAnimator != null) | ||
mMagicLinesDrawableAnimator.cancel(); | ||
if(mMyMagicLinesDrawable != null) | ||
mMyMagicLinesDrawable.setLevel(0); | ||
} | ||
|
||
@Override public boolean onItemSelected(IMyNavigation nav, MenuItem item) { | ||
|
||
boolean done = super.onItemSelected(nav, item); | ||
|
||
if(done) | ||
return true; | ||
|
||
@IdRes int id = item.getItemId(); | ||
|
||
if(id == R.id.action_whats_up) { | ||
log.i("[SNACK][SHORT]What's up mate?"); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
} |
Oops, something went wrong.