Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #2

Closed
Toss00 opened this issue Aug 5, 2014 · 0 comments
Closed

Not working #2

Toss00 opened this issue Aug 5, 2014 · 0 comments

Comments

@Toss00
Copy link

Toss00 commented Aug 5, 2014

Hello,

I want use book animation for my application but PageTurnLayout not working.

my code :

@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

    layout =  new  PageTurnLayout ( this.getBaseContext() ); 
    PageTurnLayout.LayoutParams layoutparams = new  PageTurnLayout . LayoutParams ( ViewGroup . LayoutParams.MATCH_PARENT , ViewGroup . LayoutParams.MATCH_PARENT);             
    layout . setLayoutParams ( layoutparams );
    layout.setBackgroundColor(getResources().getColor(R.color.fond));

    menus = Restaurants.menus;

    for (int i = 0; i < menus.size(); i++) {

        LinearLayout menu = new LinearLayout(layout.getContext());
        LinearLayout.LayoutParams params = new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT , Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL );             
        menu.setLayoutParams(params);
        menu.setBackgroundColor(getResources().getColor(R.color.fond));
        menu.setOrientation ( LinearLayout . VERTICAL ); 

        TextView nom = new TextView(menu.getContext());
        nom. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 1f ));
        nom.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        nom.setTypeface(TBLActivity.CLB);
        nom.setTextColor(getResources().getColor(R.color.text));
        nom.setTextSize(12);
        nom.setText(menus.get(i).nom);

        TextView descriptif = new TextView(menu.getContext());
        descriptif. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 0.4f ));
        descriptif.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        descriptif.setTypeface(TBLActivity.CLB);
        descriptif.setTextColor(getResources().getColor(R.color.text));
        descriptif.setTextSize(6);
        descriptif.setText(menus.get(i).descriptif);

        TextView prix = new TextView(menu.getContext());
        prix. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 1f ));
        prix.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        prix.setTypeface(TBLActivity.CLB);
        prix.setTextColor(getResources().getColor(R.color.text));
        prix.setTextSize(5);
        prix.setText(menus.get(i).prix);

        menu.addView(nom);
        menu.addView(descriptif);
        menu.addView(prix);

        layout.addView(menu);

    }

    setContentView(layout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants