برترین های انجمن


Popular Content

Showing most liked content on ۱۷/۱۱/۱۳ in all areas

  1. 2 likes
    ما نرم افزار ساخته ایم برای دانشجو ها . امکاناتش جالبه پیشنهاد میکنم دانلود کنید اگر مشکلی داشت یا پیشنهادی داشتید با ما اطلاع بدید . با تشکر . لینک دانلود :http://iranapps.com/app/com.hsb.daneshjoo ارتباط با ما : h.myapps@gmail.com
  2. 1 like
    سلام میتوانید از این کتابخانه استفاده کنید 1-کتابخانه اول https://github.com/lopspower/CircularProgressBar 2- کتابخانه دوم https://github.com/lzyzsd/CircleProgress CircularProgress: <com.github.lzyzsd.circleprogress.CircleProgress android:id="@+id/circle_progress" android:layout_marginLeft="50dp" android:layout_width="100dp" android:layout_height="100dp" custom:circle_progress="20"/> CircleProgress: <com.github.lzyzsd.circleprogress.CircleProgress android:id="@+id/circle_progress" android:layout_marginLeft="50dp" android:layout_width="100dp" android:layout_height="100dp" custom:circle_progress="20"/> ArcProgress: <com.github.lzyzsd.circleprogress.ArcProgress android:id="@+id/arc_progress" android:background="#214193" android:layout_marginLeft="50dp" android:layout_width="100dp" android:layout_height="100dp" custom:arc_progress="55" custom:arc_bottom_text="MEMORY"/>
  3. 1 like
    به اینصورت بنویسید public class MainActivity extends AppCompatActivity { private TabLayout tabLayout; private ViewPager viewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); viewPager = (ViewPager) findViewById(R.id.viewpager); setupViewPager(viewPager); tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(viewPager); tabLayout.setOnTabSelectedListener(onTabSelectedListener(viewPager)); } private TabLayout.OnTabSelectedListener onTabSelectedListener(final ViewPager viewPager) { return new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }; } private void setupViewPager(ViewPager viewPager) { ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager()); adapter.addFragment(new OneFragment(), "ONE"); adapter.addFragment(new TwoFragment(), "TWO"); adapter.addFragment(new ThreeFragment(), "THREE"); viewPager.setAdapter(adapter); viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); onTabSelectedListener(viewPager); } class ViewPagerAdapter extends FragmentPagerAdapter { private final List<Fragment> mFragmentList = new ArrayList<>(); private final List<String> mFragmentTitleList = new ArrayList<>(); public ViewPagerAdapter(FragmentManager manager) { super(manager); } @Override public Fragment getItem(int position) { return mFragmentList.get(position); } @Override public int getCount() { return mFragmentList.size(); } public void addFragment(Fragment fragment, String title) { mFragmentList.add(fragment); mFragmentTitleList.add(title); } @Override public CharSequence getPageTitle(int position) { return mFragmentTitleList.get(position); } } }