<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>نوشته های salimhabibly</title><link>https://virgool.ir/feed/@salimhabibly</link><description>موسس وبسایت هیروتک  تحصیلات: سیکلم (کمه ولی تو ایران فرقی نمیکنه برا ما) شغل : کارگر  با چندر غاز حقوق  که به برنامه نویسی و زیر شاخه های گرافیک علاقه زیادی داره و  تا به هدفش نرسه بیخیال نمیشه ک ک ا</description><language>fa</language><pubDate>2026-11-11 10:42:01</pubDate><image><url>https://files.virgool.ir/upload/users/155758/avatar/4y8SMY.png</url><title>salimhabibly</title><link>https://virgool.ir/@salimhabibly</link></image><item><title>آموزش های اندروید با کپی پست قسمت اول(ساخت اینترو اسلایدر با چند کلیک)</title><link>https://virgool.ir/@salimhabibly/آموزش-های-اندروید-با-کپی-پست-قسمت-اولساخت-اینترو-اسلایدر-با-چند-کلیک-omzzlxd37fsq</link><description>خب به امید خدا میخوایم از امروز یه هدفی رو شروع کنیم .این هدف  چیه...؟آموزش برنامه نویسی اندروید (البته برنامه نویسی هم نمیشه گفت بش)وقتی صحبت از برنامه نویسی اندروید میشه کدهای پیچیده و تایپ و کدنویسی های پیچیده تو ذهنمون نقش میبندهاما از امروز میخوایم این کارو آسون کنیم بطوریکه شما مثلا امروز قراره با چند تا کپی پست ساده یه اینترو اسلایدرپیشرفته یا همون صفحه معرفی برنامه رو تو یه دقیقه بسازین . فقط یک دقیقه.خب بریم سراغ آموزش امروز مون (که آموزش اولمون هم هست )آموزش ساخت اینترو اسلایدر در برنامه نویسی اندرویداول از همه بریم سراغ کتابخونه ما تو این پروژه از اندروید ایکس استفاده کردیم و بجز کتابخانه های اصلی خود برنامه فقط ازکتابخانه زیر برای ساخت دکمه متریال استفاده کردیم که ضروری که برا کدهای ما ضروریه ولی شما میتونید استفاده نکنید.implementation &#39;com.balysv:material-ripple:1.0.2&#39;خب بریم سراغ لایه های برنامه برا لایه اصلی برنامه کدهای زیر را قرار دهید. اسم لایه (activity_stepper_wizard_light)&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&#xA;&lt;LinearLayout xmlns:android=&#34;http://schemas.android.com/apk/res/android&#34;&#xA;    xmlns:app=&#34;http://schemas.android.com/apk/res-auto&#34;&#xA;    xmlns:tools=&#34;http://schemas.android.com/tools&#34;&#xA;    android:layout_width=&#34;match_parent&#34;&#xA;    android:layout_height=&#34;match_parent&#34;&#xA;    android:background=&#34;@android:color/white&#34;&#xA;    android:fitsSystemWindows=&#34;false&#34;&#xA;    android:orientation=&#34;vertical&#34;&gt;&#xA;&#xA;    &lt;androidx.constraintlayout.widget.ConstraintLayout&#xA;        android:layout_width=&#34;match_parent&#34;&#xA;        android:layout_height=&#34;0dp&#34;&#xA;        android:layout_weight=&#34;5&#34;&gt;&#xA;&#xA;&#xA;&#xA;        &lt;androidx.viewpager.widget.ViewPager&#xA;            android:id=&#34;@+id/view_pager&#34;&#xA;            android:layout_width=&#34;match_parent&#34;&#xA;            android:layout_height=&#34;match_parent&#34;&#xA;            android:background=&#34;@android:color/white&#34;&#xA;            app:layout_constraintEnd_toEndOf=&#34;parent&#34;&#xA;            app:layout_constraintStart_toStartOf=&#34;parent&#34;&#xA;            app:layout_constraintTop_toTopOf=&#34;parent&#34;/&gt;&#xA;&#xA;        &lt;ImageButton&#xA;            android:id=&#34;@+id/bt_close&#34;&#xA;            android:layout_width=&#34;35dp&#34;&#xA;            android:layout_height=&#34;35dp&#34;&#xA;            android:layout_marginStart=&#34;300dp&#34;&#xA;            android:layout_marginTop=&#34;8dp&#34;&#xA;            app:layout_constraintEnd_toEndOf=&#34;parent&#34;&#xA;            app:layout_constraintStart_toStartOf=&#34;parent&#34;&#xA;            app:layout_constraintTop_toTopOf=&#34;parent&#34;&#xA;            android:src=&#34;@android:drawable/ic_menu_close_clear_cancel&#34;&#xA;            app:srcCompat=&#34;@android:drawable/ic_menu_close_clear_cancel&#34; /&gt;&#xA;&#xA;&#xA;    &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;&#xA;&#xA;    &lt;LinearLayout&#xA;        android:id=&#34;@+id/layoutDots&#34;&#xA;        android:layout_width=&#34;match_parent&#34;&#xA;        android:layout_height=&#34;0dp&#34;&#xA;        android:layout_weight=&#34;1&#34;&#xA;        android:background=&#34;@android:color/white&#34;&#xA;        android:gravity=&#34;center|top&#34;&#xA;        android:orientation=&#34;horizontal&#34; /&gt;&#xA;&#xA;    &lt;com.balysv.materialripple.MaterialRippleLayout&#xA;        style=&#34;@style/RippleStyleBlack&#34;&#xA;        android:layout_width=&#34;match_parent&#34;&#xA;        android:layout_height=&#34;wrap_content&#34;&#xA;        android:orientation=&#34;vertical&#34;&gt;&#xA;&#xA;        &lt;Button&#xA;            android:id=&#34;@+id/btn_next&#34;&#xA;            android:layout_width=&#34;match_parent&#34;&#xA;            android:layout_height=&#34;wrap_content&#34;&#xA;            android:background=&#34;@color/grey_10&#34;&#xA;            android:text=&#34;@string/NEXT&#34;&#xA;            android:textAppearance=&#34;@style/TextAppearance.AppCompat.Subhead&#34;&#xA;            android:textColor=&#34;@color/grey_90&#34;&#xA;            android:textStyle=&#34;bold&#34; /&gt;&#xA;&#xA;    &lt;/com.balysv.materialripple.MaterialRippleLayout&gt;&#xA;&#xA;&lt;/LinearLayout&gt;یه لایه هم جدا برای آیتم های اسلایدرمون میسازیم (مثلا تصاویر متن و توضیحات ) اسم لایه هم (item_stepper_wizard)&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&#xA;&lt;RelativeLayout xmlns:android=&#34;http://schemas.android.com/apk/res/android&#34;&#xA;    android:id=&#34;@+id/lyt_parent&#34;&#xA;    android:layout_width=&#34;match_parent&#34;&#xA;    android:layout_height=&#34;match_parent&#34;&#xA;    android:background=&#34;@android:color/white&#34;&#xA;    android:padding=&#34;18dp&#34;&gt;&#xA;&#xA;    &lt;LinearLayout&#xA;        android:layout_width=&#34;match_parent&#34;&#xA;        android:layout_height=&#34;match_parent&#34;&#xA;        android:layout_alignParentBottom=&#34;false&#34;&#xA;        android:layout_centerHorizontal=&#34;true&#34;&#xA;        android:gravity=&#34;center_horizontal&#34;&#xA;        android:orientation=&#34;vertical&#34;&gt;&#xA;&#xA;        &lt;ImageView&#xA;            android:id=&#34;@+id/image&#34;&#xA;            android:layout_width=&#34;300dp&#34;&#xA;            android:layout_height=&#34;300dp&#34;&#xA;            android:padding=&#34;@dimen/spacing_xlarge&#34;&#xA;            android:src=&#34;@drawable/img_wizard_1&#34; /&gt;&#xA;&#xA;        &lt;TextView&#xA;            android:id=&#34;@+id/title&#34;&#xA;            android:layout_width=&#34;wrap_content&#34;&#xA;            android:layout_height=&#34;wrap_content&#34;&#xA;            android:text=&#34;Ready to Travel&#34;&#xA;            android:textAppearance=&#34;@style/TextAppearance.AppCompat.Medium&#34;&#xA;            android:textColor=&#34;@color/grey_80&#34;&#xA;            android:textStyle=&#34;bold&#34; /&gt;&#xA;&#xA;        &lt;TextView&#xA;            android:id=&#34;@+id/description&#34;&#xA;            android:layout_width=&#34;match_parent&#34;&#xA;            android:layout_height=&#34;wrap_content&#34;&#xA;            android:layout_marginTop=&#34;@dimen/spacing_middle&#34;&#xA;            android:text=&#34;Find Featured and Premium \nItem From Our Store&#34;&#xA;            android:textAlignment=&#34;center&#34;&#xA;            android:textAppearance=&#34;@style/TextAppearance.AppCompat.Subhead&#34;&#xA;            android:textColor=&#34;@color/grey_60&#34; /&gt;&#xA;&#xA;    &lt;/LinearLayout&gt;&#xA;&lt;/RelativeLayout&gt;خب بریم سراغ آقای جاوا (جنسیتش میخوره آقا باشه )یه اکتیویتی با نام (َActivitySteperWizardLight) بسازین و کدهای زیرو  توش بزارین !!!! (امیدوارم مثل من   م...ف نباشید وضعیتم بد خرابه باید یه فکری براش بکنم :)  )import android.content.Context;&#xA;import android.content.Intent;&#xA;import android.content.SharedPreferences;&#xA;import android.graphics.Color;&#xA;import android.graphics.PorterDuff;&#xA;import android.os.Bundle;&#xA;import android.view.LayoutInflater;&#xA;import android.view.View;&#xA;import android.view.ViewGroup;&#xA;import android.widget.Button;&#xA;import android.widget.ImageButton;&#xA;import android.widget.ImageView;&#xA;import android.widget.LinearLayout;&#xA;import android.widget.TextView;&#xA;&#xA;&#xA;import androidx.appcompat.app.AppCompatActivity;&#xA;import androidx.viewpager.widget.PagerAdapter;&#xA;import androidx.viewpager.widget.ViewPager;&#xA;&#xA;import com.herotech.lalaey.utils.Tools;&#xA;&#xA;&#xA;public class ActivitySteperWizardLight extends AppCompatActivity {&#xA;&#xA;    private static final int MAX_STEP = 4;&#xA;&#xA;    private ViewPager viewPager;&#xA;    private MyViewPagerAdapter myViewPagerAdapter;&#xA;    private Button btnNext;&#xA;    private String about_description_array[];&#xA;    private String about_title_array[];&#xA;    // متن تیتر بزرگ&#xA;//    private String about_title_array[] = {&#xA;//         &#34;&#34;,&#xA;  //       &#34;&#34;,&#xA;  //       &#34;&#34;,&#34;&#34;&#xA;&#xA;//    };&#xA;    // توضیحات تیتر کوچک&#xA;//    private String about_description_array[] = {&#xA;////         &#34;&#34;,&#xA;//  //       &#34;&#34;,&#xA;//  //       &#34;&#34;,&#34;&#xA;//    };&#xA;    private int about_images_array[] = {&#xA;            R.drawable.img_wizard_1,&#xA;            R.drawable.img_wizard_2,&#xA;            R.drawable.img_wizard_3,&#xA;            R.drawable.img_wizard_4&#xA;    };&#xA;    boolean BareAval= true;&#xA;    SharedPreferences sharedP;&#xA;    @Override&#xA;    protected void onCreate(Bundle savedInstanceState) {&#xA;        super.onCreate(savedInstanceState);&#xA;        setContentView(R.layout.activity_stepper_wizard_light);&#xA;&#xA;        about_title_array = getResources().getStringArray(R.array.about_title);&#xA;        about_description_array = getResources().getStringArray(R.array.about_description);&#xA;&#xA;        initComponent();&#xA;        Tools.setSystemBarColor(this, R.color.grey_5);&#xA;        Tools.setSystemBarLight(this);&#xA;    }&#xA;&#xA;    private void initComponent() {&#xA;        viewPager = (ViewPager) findViewById(R.id.view_pager);&#xA;        btnNext = (Button) findViewById(R.id.btn_next);&#xA;&#xA;        // adding bottom dots&#xA;        bottomProgressDots(0);&#xA;&#xA;        myViewPagerAdapter = new MyViewPagerAdapter();&#xA;        viewPager.setAdapter(myViewPagerAdapter);&#xA;        viewPager.addChangeListener(viewPagerPageChangeListener);&#xA;        btnNext.setListener(new View.Listener() {&#xA;            @Override&#xA;            public void (View v) {&#xA;                int current = viewPager.getCurrentItem() + 1;&#xA;                if (current &lt; MAX_STEP) {&#xA;                    // move to next screen&#xA;                    viewPager.setCurrentItem(current);&#xA;                } else {&#xA;                    Intent i =new Intent(ActivitySteperWizardLight.this,MainActivity.class);&#xA;                    startActivity(i);&#xA;                }&#xA;            }&#xA;        });&#xA;&#xA;        ((ImageButton)findViewById(R.id.bt_close)).setListener(new View.Listener() {&#xA;            @Override&#xA;            public void (View v) {&#xA;                Intent i =new Intent(ActivitySteperWizardLight.this,MainActivity.class);&#xA;                startActivity(i);&#xA;            }&#xA;        });&#xA;&#xA;    }&#xA;&#xA;    private void bottomProgressDots(int current_index) {&#xA;        LinearLayout dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);&#xA;        ImageView[] dots = new ImageView[MAX_STEP];&#xA;&#xA;        dotsLayout.removeAllViews();&#xA;        for (int i = 0; i &lt; dots.length; i++) {&#xA;            dots[i] = new ImageView(this);&#xA;            int width_height = 15;&#xA;            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(new ViewGroup.LayoutParams(width_height, width_height));&#xA;            params.setMargins(10, 10, 10, 10);&#xA;            dots[i].setLayoutParams(params);&#xA;            dots[i].setImageResource(R.drawable.shape_circle);&#xA;            dots[i].setColorFilter(getResources().getColor(R.color.grey_20), PorterDuff.Mode.SRC_IN);&#xA;            dotsLayout.addView(dots[i]);&#xA;        }&#xA;&#xA;        if (dots.length &gt; 0) {&#xA;            dots[current_index].setImageResource(R.drawable.shape_circle);&#xA;            dots[current_index].setColorFilter(getResources().getColor(R.color.colorPrimaryLight), PorterDuff.Mode.SRC_IN);&#xA;        }&#xA;    }&#xA;&#xA;    //  viewpager change listener&#xA;    ViewPager.ChangeListener viewPagerPageChangeListener = new ViewPager.ChangeListener() {&#xA;&#xA;        @Override&#xA;        public void Selected(final int position) {&#xA;            bottomProgressDots(position);&#xA;&#xA;            if (position == about_title_array.length - 1) {&#xA;                btnNext.setText(getString(R.string.GOT_IT));&#xA;                btnNext.setBackgroundColor(getResources().getColor(R.color.orange_400));&#xA;                btnNext.setTextColor(Color.WHITE);&#xA;&#xA;            } else {&#xA;                btnNext.setText(getString(R.string.NEXT));&#xA;                btnNext.setBackgroundColor(getResources().getColor(R.color.grey_10));&#xA;                btnNext.setTextColor(getResources().getColor(R.color.grey_90));&#xA;            }&#xA;        }&#xA;&#xA;        @Override&#xA;        public void Scrolled(int arg0, float arg1, int arg2) {&#xA;&#xA;        }&#xA;&#xA;        @Override&#xA;        public void ScrollStateChanged(int arg0) {&#xA;&#xA;        }&#xA;    };&#xA;&#xA;    /**&#xA;     * View pager adapter&#xA;     */&#xA;    public class MyViewPagerAdapter extends PagerAdapter {&#xA;        private LayoutInflater layoutInflater;&#xA;&#xA;        public MyViewPagerAdapter() {&#xA;        }&#xA;&#xA;        @Override&#xA;        public Object instantiateItem(ViewGroup container, int position) {&#xA;            layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);&#xA;&#xA;            View view = layoutInflater.inflate(R.layout.item_stepper_wizard, container, false);&#xA;            ((TextView) view.findViewById(R.id.title)).setText(about_title_array[position]);&#xA;            ((TextView) view.findViewById(R.id.description)).setText(about_description_array[position]);&#xA;            ((ImageView) view.findViewById(R.id.image)).setImageResource(about_images_array[position]);&#xA;            container.addView(view);&#xA;&#xA;            return view;&#xA;        }&#xA;&#xA;        @Override&#xA;        public int getCount() {&#xA;            return about_title_array.length;&#xA;        }&#xA;&#xA;        @Override&#xA;        public boolean isViewFromObject(View view, Object obj) {&#xA;            return view == obj;&#xA;        }&#xA;&#xA;&#xA;        @Override&#xA;        public void destroyItem(ViewGroup container, int position, Object object) {&#xA;            View view = (View) object;&#xA;            container.removeView(view);&#xA;        }&#xA;    }خب میشه گفت تمومه فقط مونده چند خط کد هم تو main activity بزاریم تا صفحه معرفی برناممون فقط تو اجرای اول نمایش بده :کد های زیر رو تو on create main activity قرار بدید:Boolean isFirstRun = getSharedPreferences(&#34;PREFERENCE&#34;, MODE_PRIVATE)&#xA;                .getBoolean(&#34;isFirstRun&#34;, true);&#xA;        if (isFirstRun) {&#xA;            //show start activity&#xA;            startActivity(new Intent(MainActivity.this, ActivitySteperWizardLight.class));&#xA;&#xA;&#xA;        }&#xA;&#xA;        getSharedPreferences(&#34;PREFERENCE&#34;, MODE_PRIVATE).edit()&#xA;                .putBoolean(&#34;isFirstRun&#34;, false).commit();تمومه شما الان یه اینترو اسلایدر حرفه ایی یا همون اسلایدر معرفی برنامه یا هرچی اسمشو میزارین ساختینراستی تو این پروژه ما از چهار تا عکس و دو تا آرایه از نو ع استرینگ تعریف کردیم که عکسها رو خودتون یه چیزی بزاریدولی میتونید از آرایه های زیر استفاده کنید . بزاریدش تو strings برنامتون.&lt;string-array name=&#34;about_title&#34;&gt;&#xA;        &lt;item&gt;طراحی متریال و جذاب&lt;/item&gt;&#xA;        &lt;item&gt;لالایی های آرام&lt;/item&gt;&#xA;        &lt;item&gt;بک گراند ها کودکانه همراه با انیمیشن&lt;/item&gt;&#xA;        &lt;item&gt;هنوز اول راهه&lt;/item&gt;&#xA;    &lt;/string-array&gt;&#xA;    &lt;string-array name=&#34;about_description&#34;&gt;&#xA;        &lt;item&gt;این برنامه با طراحی متریال و با جدید ترین متد ها ساخته شده است&lt;/item&gt;&#xA;        &lt;item&gt;با لالایی های آرام و زیبای کودکانه خوابی آرام برای کودکانتان فراهم کنید&lt;/item&gt;&#xA;        &lt;item&gt;بکگراند های کودکانه بهمراه انیمیشن آرام&lt;/item&gt;&#xA;        &lt;item&gt;هنوز اول راهه این برنامه همواره آپدیت خواهد شد.&lt;/item&gt;&#xA;    &lt;/string-array&gt;اگه مشکلی داشتین تو نظرات در خدمتتون هستم و سعی میکنم خیلی زود یه ویدیو هم برای آموزش درست کنم یا حق.ویدیو رو بزودی تو سایت میزارم https://hero-tech.ir/easy-intro-slider-tuts-in-android/</description><category>salimhabibly</category><author>salimhabibly</author><pubDate>Mon, 23 Mar 2020 21:40:36 +0430</pubDate></item></channel></rss>