Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package com.example.carl.mdhschemaapp;
- import android.app.Fragment;
- import android.os.Bundle;
- import android.support.v7.widget.CardView;
- import android.util.Log;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.SeekBar;
- import android.widget.TextView;
- import java.util.Random;
- /**
- * Fragment that demonstrates how to use CardView.
- */
- public class CardViewFragment extends Fragment {
- private static final String TAG = CardViewFragment.class.getSimpleName();
- /** The CardView widget. */
- //@VisibleForTesting
- CardView mCardView;
- /**
- * SeekBar that changes the cornerRadius attribute for the {@link #mCardView} widget.
- */
- //@VisibleForTesting
- SeekBar mRadiusSeekBar;
- /**
- * SeekBar that changes the Elevation attribute for the {@link #mCardView} widget.
- */
- //@VisibleForTesting
- SeekBar mElevationSeekBar;
- /**
- * Use this factory method to create a new instance of
- * this fragment using the provided parameters.
- *
- * @return A new instance of fragment NotificationFragment.
- */
- public static CardViewFragment newInstance() {
- CardViewFragment fragment = new CardViewFragment();
- fragment.setRetainInstance(true);
- return fragment;
- }
- public CardViewFragment() {
- // Required empty public constructor
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- // Inflate the layout for this fragment
- return inflater.inflate(R.layout.fragment_card_view, container, false);
- }
- @Override
- public void onViewCreated(View view, Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- mCardView = (CardView) view.findViewById(R.id.cardview);
- TextView kek = (TextView) view.findViewById(R.id.Course);
- int random = (int )(Math.random() * 50 + 1);
- String test = Integer.toString(random);
- kek.setText(test);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement