Comments (3)
Hey @joaosardinha
Can you provide some code example of your GuillotineActivity implementation and details of problem? So I can help you solve this.
from guillotinemenu-android.
Hey absolutely!
MainActivity.java:
//No changes from the original sample
//@InjectView...
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
ButterKnife.inject(this);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
}
View guillotineMenu = LayoutInflater.from(this).inflate(R.layout.guillotine, null);
root.addView(guillotineMenu);
new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.guillotine_hamburger), contentHamburger)
.setStartDelay(RIPPLE_DURATION)
.setActionBarViewForAnimation(toolbar)
.setClosedOnStart(true)
.build();
}
The guillotine.xml and activity.xml layouts are just like in the original sample, with the hamburgers in the right side of the ActionBar and the GUILLOTINE_CLOSED_ANGLE as 90f.
I created an activity class for the guillotine.xml layout:
public class GuillotineActivity extends AppCompatActivity {
@InjectView(R.id.button1)
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.guillotine);
ButterKnife.inject(this);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(GuillotineActivity.this, MainActivity.class));
}
});
}
}
My problem is, simple things as a button calling startActivity won't work inside the Guillotine activity making it nothing more than a layout instead of an activity.
I haven't change anything in the library expect the GUILLOTINE_CLOSED_ANGLE float.
Any thoughts of how to turn it into a real activity?
from guillotinemenu-android.
Well, if I understand correctly, what you want is to encapsulate some logic inside class of navigation menu, so it won't be just a layout. If this is the case, then you can extend View, use this layout and put all the logic you need inside. Then add your custom View to your MainActivity instead of inflating layout.
But if you want both elements to be activities and have this kind of animation, then this lib won't satisfy your needs completely. You can look into http://developer.android.com/training/material/animations.html to achieve similar behaviour
from guillotinemenu-android.
Related Issues (20)
- Error inflating class CanaroTextView HOT 1
- Change Log
- Right To Left Animation Problem! HOT 1
- How do button work in menu HOT 1
- Menu crashed on 4.2.2 HOT 3
- How to programmatically check if the if the menu is opened or close?? HOT 3
- Handle right-to-left layouts
- What icon pack did you used in sample application?
- Provide generic Interpolator
- Attempt to invoke virtual method - addView HOT 2
- check Open HOT 1
- I still can click a button beneath guillotine menu HOT 2
- open/close by code HOT 3
- import butterknife.BindView; import butterknife.ButterKnife; HOT 2
- GuillotineMenu doesn't display HOT 1
- java.lang.ClassNotFoundException: Didn't find class HOT 2
- clone issue
- why components clicked when menu bar is open?
- Rty
- Access
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guillotinemenu-android.