diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..8a38e6d --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Truth and Dare \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a0de2a1 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..112ebc6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..63d8f14 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,54 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.status.truthanddare' + compileSdk 33 + + defaultConfig { + applicationId "com.status.truthanddare" + minSdk 23 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'com.google.android.material:material:1.8.0' + implementation 'com.amitshekhar.android:android-networking:1.0.2' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + implementation "com.github.smarteist:autoimageslider:1.3.9" + +// dependency for loading image from url + + implementation "com.github.bumptech.glide:glide:4.11.0" + //op + + implementation "androidx.viewpager2:viewpager2:1.0.0" + +//rounded imageview + implementation 'com.makeramen:roundedimageview:2.3.0' + + + //ynha tk + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/status/truthanddare/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/status/truthanddare/ExampleInstrumentedTest.java new file mode 100644 index 0000000..8e96050 --- /dev/null +++ b/app/src/androidTest/java/com/status/truthanddare/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.status.truthanddare; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.status.truthanddare", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b4cbc82 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..c27dbe4 Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/java/com/status/truthanddare/Adapter/SliderAdapter.java b/app/src/main/java/com/status/truthanddare/Adapter/SliderAdapter.java new file mode 100644 index 0000000..3cecf72 --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/Adapter/SliderAdapter.java @@ -0,0 +1,70 @@ +package com.status.truthanddare.Adapter; + +import static android.media.CamcorderProfile.get; + +import android.os.Handler; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager2.widget.ViewPager2; + + +import com.makeramen.roundedimageview.RoundedImageView; +import com.status.truthanddare.R; +import com.status.truthanddare.modelclass.ImageSlider; + +import java.util.List; + +public class SliderAdapter extends RecyclerView.Adapter { + private final List sliderItems; + Handler ImageSlider=new Handler(); + private final ViewPager2 viewPager2; + + public SliderAdapter(List sliderItems, ViewPager2 viewPager2) { + this.sliderItems=sliderItems; + this.viewPager2=viewPager2; + } + + @NonNull + @Override + public SliderViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new SliderViewHolder( + LayoutInflater.from(parent.getContext()).inflate( + R.layout.sliderimage, parent, false + ) ); + } + @Override + public void onBindViewHolder(@NonNull SliderViewHolder holder, int position) { + holder.setImage(sliderItems.get(position)); + if (position == sliderItems.size()- 2){ + viewPager2.post(runnable); + } + } + @Override + public int getItemCount() { + return sliderItems.size(); + } + class SliderViewHolder extends RecyclerView.ViewHolder { + private RoundedImageView imageView; + SliderViewHolder(@NonNull View itemView) { + super(itemView); + imageView = itemView.findViewById(R.id.imageSlide); + } + void setImage(ImageSlider sliderItems){ +//use glide or picasso in case you get image from internet + imageView.setImageResource(sliderItems.getImage()); + } + } + private Runnable runnable = new Runnable() { + @Override + public void run() { + sliderItems.addAll(sliderItems); + notifyDataSetChanged(); + } + }; +} + + diff --git a/app/src/main/java/com/status/truthanddare/ApiCalling.java b/app/src/main/java/com/status/truthanddare/ApiCalling.java new file mode 100644 index 0000000..6948b95 --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/ApiCalling.java @@ -0,0 +1,108 @@ +package com.status.truthanddare; + +import android.content.Context; +import android.util.Log; +import android.widget.Toast; + +import com.androidnetworking.AndroidNetworking; +import com.androidnetworking.common.Priority; +import com.androidnetworking.error.ANError; +import com.androidnetworking.interfaces.JSONObjectRequestListener; +import org.json.JSONException; +import org.json.JSONObject; + +public class ApiCalling { + static final String TRUTH="https://api.truthordarebot.xyz/v1/truth"; + static final String DARE="https://api.truthordarebot.xyz/v1/dare"; + Context context; + public static String LANGUAGE="ENG"; + + public String getLANGUAGE() { + return LANGUAGE; + } + + public void setLANGUAGE(String LANGUAGE) { + ApiCalling.LANGUAGE = LANGUAGE; + } + + + String ANSWER=null; + + ApiCalling(Context context){ + + this.context=context; + Toast.makeText(context, getLANGUAGE(), Toast.LENGTH_SHORT).show(); + + } + + void apiCallingp() { + + LANGUAGE= getLANGUAGE(); + + AndroidNetworking.initialize(context); + AndroidNetworking.get(TRUTH).setPriority(Priority.HIGH).build().getAsJSONObject(new JSONObjectRequestListener() { + @Override + public void onResponse(JSONObject response) { + Log.d("Response", "Response working"); + try { + + if (LANGUAGE.equals("ENG")) { + ANSWER = response.getString("question"); + } else { + JSONObject obj = new JSONObject(); + obj = response.getJSONObject("translations"); + ANSWER = obj.getString(LANGUAGE); + + } + + + } catch (JSONException e) { + throw new RuntimeException(e); + } + } + + @Override + public void onError(ANError anError) { + Log.d("Response", anError.toString()); + Toast.makeText(context, "Error", Toast.LENGTH_SHORT).show(); + } + }); + } + public void dareAns(){ + AndroidNetworking.initialize(context); + AndroidNetworking.get(DARE).setPriority(Priority.HIGH).build().getAsJSONObject(new JSONObjectRequestListener() { + @Override + public void onResponse(JSONObject response) { + Log.d("Response", "Response working"); + try { + + if (LANGUAGE.equals("ENG")) { + ANSWER = response.getString("question"); + } else { + JSONObject obj = new JSONObject(); + obj = response.getJSONObject("translations"); + ANSWER = obj.getString(LANGUAGE); + + } + + + } catch (JSONException e) { + throw new RuntimeException(e); + } + } + + @Override + public void onError(ANError anError) { + Log.d("Response", anError.toString()); + Toast.makeText(context, "Error", Toast.LENGTH_SHORT).show(); + } + }); + + } + public String answer(){ + return ANSWER; + } + + + +} diff --git a/app/src/main/java/com/status/truthanddare/BottomSheet.java b/app/src/main/java/com/status/truthanddare/BottomSheet.java new file mode 100644 index 0000000..201a689 --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/BottomSheet.java @@ -0,0 +1,151 @@ +package com.status.truthanddare; + +import android.annotation.SuppressLint; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.Spinner; +import android.widget.Toast; + +import androidx.appcompat.app.AppCompatDelegate; + +import com.google.android.material.bottomsheet.BottomSheetDialogFragment; + + +public class BottomSheet extends BottomSheetDialogFragment { + + com.google.android.material.switchmaterial.SwitchMaterial aSwitch; + Spinner spinner; + String[] aa = {"ENG", "bn", "hi", "de", "fr", "es", "tl", "Eng"}; + + MainActivity activity; + + + public BottomSheet() { + + + } + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + activity = (MainActivity) getActivity(); + + View view = inflater.inflate(R.layout.fragment_bottom_sheet, container, false); + aSwitch = view.findViewById(R.id.switch1); + + + if (activity.sharedPreferences.getBoolean("mode", false)) { + aSwitch.setChecked(true); + } + spinner = view.findViewById(R.id.spinner); + String p = activity.sharedPreferences.getString("lang", "ENG"); + + for (int i = 0; i < aa.length; i++) { + if (aa[i].equals(p)) { + Toast.makeText(activity, p, Toast.LENGTH_SHORT).show(); + spinner.setSelection(i); + break; + } + } + + + Button hide = view.findViewById(R.id.hide); + + // spinner.setSelection(2); + + aSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> okk(isChecked)); + + ApiCalling apiCalling = new ApiCalling(activity); + + spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView parent, View view, int position, long id) { + String lang; + if (position == 0) { + apiCalling.setLANGUAGE("ENG"); + lang = "ENG"; + } else if (position == 1) { + // apiCalling.LANGUAGE="bn"; + apiCalling.setLANGUAGE("bn"); + lang = "bn"; + } else if (position == 2) { + apiCalling.setLANGUAGE("hi"); + lang = "hi"; + + } else if (position == 3) { + apiCalling.setLANGUAGE("de"); + lang = "de"; + + + } else if (position == 4) { + apiCalling.setLANGUAGE("fr"); + lang = "fr"; + + } else if (position == 5) { + apiCalling.setLANGUAGE("es"); + lang = "es"; + + + } else if (position == 6) { + apiCalling.setLANGUAGE("tl"); + lang = "tl"; + + } else { + apiCalling.setLANGUAGE("ENG"); + lang = "ENG"; + } + + activity.myedit.putString("lang", lang); + activity.myedit.commit(); + + } + + @Override + public void onNothingSelected(AdapterView parent) { + + } + }); + + // Inflate the layout for this fragment + hide.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (!activity.bottomSheet.isHidden()) { + activity.bottomSheet.dismiss(); + } + + + } + }); + return view; + } + + + @SuppressLint("SetTextI18n") + public void okk(boolean ischecked) { + + //final boolean isDarkModeOn = false;//sharedPreferences.getBoolean("isDarkModeOn", false); + + if (ischecked) { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + aSwitch.setText("Disable Dark Mode"); + activity.bottomSheet.dismiss(); + activity.myedit.putBoolean("mode", true); + + } else { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + aSwitch.setText("Enable Dark mode "); + aSwitch.setChecked(false); + activity.bottomSheet.dismiss(); + activity.myedit.putBoolean("mode", false); + } + + activity.myedit.commit(); + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/status/truthanddare/MainActivity.java b/app/src/main/java/com/status/truthanddare/MainActivity.java new file mode 100644 index 0000000..68dfac7 --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/MainActivity.java @@ -0,0 +1,281 @@ +package com.status.truthanddare; + +import android.annotation.SuppressLint; +import android.content.ActivityNotFoundException; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.Uri; +import android.os.Bundle; +import android.os.Handler; +import android.view.View; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager2.widget.CompositePageTransformer; +import androidx.viewpager2.widget.MarginPageTransformer; +import androidx.viewpager2.widget.ViewPager2; + +import com.status.truthanddare.Adapter.SliderAdapter; +import com.status.truthanddare.modelclass.ImageSlider; + +import java.util.ArrayList; +import java.util.List; + +public class MainActivity extends AppCompatActivity { + + com.google.android.material.floatingactionbutton.FloatingActionButton button; + BottomSheet bottomSheet; + SharedPreferences.Editor myedit; + SharedPreferences sharedPreferences; + ViewPager2 viewPager2; + private final Handler sliderHandler = new Handler(); + com.google.android.material.button.MaterialButton whatsapp, shareToApp, copyText,follow; + TextView question; + androidx.cardview.widget.CardView b1, b2; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + + viewPager2 = findViewById(R.id.viewPagerImageSlider); + + List sliderItems = new ArrayList<>(); + sliderItems.add(new ImageSlider(R.drawable.img2)); + sliderItems.add(new ImageSlider(R.drawable.img3)); + sliderItems.add(new ImageSlider(R.drawable.img1)); + sliderItems.add(new ImageSlider(R.drawable.img4)); + + + + viewPager2.setAdapter(new SliderAdapter(sliderItems,viewPager2)); + + viewPager2.setClipToPadding(false); + viewPager2.setClipChildren(false); + viewPager2.setOffscreenPageLimit(3); + viewPager2.getChildAt(0).setOverScrollMode(RecyclerView.OVER_SCROLL_NEVER); + CompositePageTransformer compositePageTransformer = new CompositePageTransformer(); + compositePageTransformer.addTransformer(new MarginPageTransformer(40)); +/* + NetworkConnectionCheck networkConnectionCheck=new NetworkConnectionCheck(this); + + ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(ConnectivityManager.class); + connectivityManager.requestNetwork(networkConnectionCheck.networkRequest,networkConnectionCheck.networkCallback); +*/ + compositePageTransformer.addTransformer(new ViewPager2.PageTransformer() { + @Override + public void transformPage(@NonNull View page, float position) { + float r = 1 - Math.abs(position); + page.setScaleY(0.85f + r * 0.15f); + } + }); + + viewPager2.setPageTransformer(compositePageTransformer); + viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { + @Override + public void onPageSelected(int position) { + super.onPageSelected(position); + sliderHandler.removeCallbacks(sliderRunnable); + sliderHandler.postDelayed(sliderRunnable, 2000); // slide duration 2 seconds + } + }); + + + sharedPreferences = getSharedPreferences("Dark", MODE_PRIVATE); + myedit = sharedPreferences.edit(); + boolean mode = sharedPreferences.getBoolean("mode", false); + if (mode) + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + + + b1 = findViewById(R.id.truth); + whatsapp = findViewById(R.id.whatsappshare); + shareToApp = findViewById(R.id.shareToApps); + shareToApp.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + shareToApps(question.getText().toString()); + } + }); + + //follow button + follow=findViewById(R.id.follow); + follow.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + instgramMethod(); + + + } + }); + + // Copy Text button + copyText = findViewById(R.id.copytext); + copyText.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + copyText(question.getText().toString()); + } + }); + + + whatsapp.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + whatsappShare(question.getText().toString()); + } + }); + + + // bottomSheet.spinner.setSelection(); + + + b2 = findViewById(R.id.dare); + button = findViewById(R.id.FButoon); + + question = findViewById(R.id.QuestionShow); + animation(question); + ApiCalling apiCalling = new ApiCalling(getApplicationContext()); + apiCalling.setLANGUAGE(sharedPreferences.getString("lang", "ENG")); + apiCalling.apiCallingp(); + apiCalling.dareAns(); + + // Truth Button + b1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + + // oTruth(); + + question.setText(apiCalling.answer()); + apiCalling.apiCallingp(); + // sw.setImageResource(R.drawable.pro); + } + }); + + //Dare Button + + b2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(getApplicationContext(), "Next Image", + Toast.LENGTH_LONG).show(); + apiCalling.dareAns(); + question.setText(apiCalling.answer()); + + // oDare(); + // sw.setImageResource(R.drawable.pro1); + } + }); + + // Bottom Sheet + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + bottomSheet = new BottomSheet(); + bottomSheet.show(getSupportFragmentManager(), bottomSheet.getTag()); + } + }); + + + } + + private void instgramMethod() { + Uri uri = Uri.parse("http://instagram.com/Its_Aashi_pandit"); + Intent likeIng = new Intent(Intent.ACTION_VIEW, uri); + likeIng.setPackage("com.instagram.android"); + try { + startActivity(likeIng); + } catch (ActivityNotFoundException e) { + startActivity(new Intent(Intent.ACTION_VIEW, + Uri.parse("http://instagram.com/Its_Aashi_pandit"))); + } + } + + @SuppressLint("QueryPermissionsNeeded") + void whatsappShare(String text) { + + // String toNumber = "+91 80532 75720"; // contains spaces. + // toNumber = toNumber.replace("+", "").replace(" ", ""); + + Intent sendIntent = new Intent("android.intent.action.MAIN"); + sendIntent.putExtra("jid", "@s.whatsapp.net"); + sendIntent.putExtra(Intent.EXTRA_TEXT, text); + sendIntent.setAction(Intent.ACTION_SEND); + sendIntent.setPackage("com.whatsapp"); + sendIntent.setType("text/plain"); + startActivity(sendIntent); + + } + + void shareToApps(String text) { + + Intent sendIntent = new Intent(Intent.ACTION_SEND); + sendIntent.putExtra(Intent.EXTRA_TEXT, text); + sendIntent.setType("text/plain"); + +// (Optional) Here we're setting the title of the content + sendIntent.putExtra(Intent.EXTRA_TITLE, "Truth Dare App"); + // sendIntent.setType("text/plain"); + +// (Optional) Here we're passing a content URI to an image to be displayed + // sendIntent.setData(contentUri); + sendIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + +// Show the Sharesheet + startActivity(Intent.createChooser(sendIntent, null)); + } + + void copyText(String text) { + +// Gets a handle to the clipboard service. + ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); + // Creates a new text clip to put on the clipboard + ClipData clip = ClipData.newPlainText(" ", text); + Toast.makeText(this, "copied", Toast.LENGTH_SHORT).show(); + // Set the clipboard's primary clip. + clipboard.setPrimaryClip(clip); + } + Runnable sliderRunnable = new Runnable() { + @Override + public void run() { + viewPager2.setCurrentItem(viewPager2.getCurrentItem() + 1); + } + }; + @Override + protected void onPause() { + super.onPause(); + sliderHandler.removeCallbacks(sliderRunnable); + } + + @Override + protected void onResume() { + super.onResume(); + sliderHandler.postDelayed(sliderRunnable, 2000); + } + + void animation(TextView textView){ + Animation anim = new AlphaAnimation(0.0f, 1.0f); + anim.setDuration(900); //You can manage the blinking time with this parameter + anim.setStartOffset(20); + anim.setRepeatMode(Animation.REVERSE); + anim.setRepeatCount(Animation.INFINITE); + textView.startAnimation(anim); + } + + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/status/truthanddare/Network/NetworkConnectionCheck.java b/app/src/main/java/com/status/truthanddare/Network/NetworkConnectionCheck.java new file mode 100644 index 0000000..7e06b8e --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/Network/NetworkConnectionCheck.java @@ -0,0 +1,53 @@ +package com.status.truthanddare.Network; + +import android.net.ConnectivityManager; +import android.net.Network; +import android.net.NetworkCapabilities; +import android.net.NetworkRequest; +import android.widget.Toast; + +import androidx.annotation.NonNull; + +import com.status.truthanddare.MainActivity; + +public class NetworkConnectionCheck { + + //Note: + //This Class Is not Implemented yet. + //I will Add this is next Version + // Thanks you + MainActivity mainActivity; + public NetworkRequest networkRequest; + + public NetworkConnectionCheck(MainActivity mainActivity){ + + networkRequest=new NetworkRequest.Builder().addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) + .addTransportType(NetworkCapabilities.TRANSPORT_WIFI).addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR).build(); + this.mainActivity=mainActivity; + } + public ConnectivityManager.NetworkCallback networkCallback=new ConnectivityManager.NetworkCallback(){ + @Override + public void onAvailable(@NonNull Network network) { + super.onAvailable(network); + } + + @Override + public void onLost(@NonNull Network network) { + super.onLost(network); + Toast.makeText(mainActivity, "Connection Lost", Toast.LENGTH_SHORT).show(); + } + + @Override + public void onCapabilitiesChanged(@NonNull Network network, @NonNull NetworkCapabilities networkCapabilities) { + super.onCapabilitiesChanged(network, networkCapabilities); + final boolean unmetered=networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED); + + } + + + }; + + + + +} diff --git a/app/src/main/java/com/status/truthanddare/modelclass/ImageSlider.java b/app/src/main/java/com/status/truthanddare/modelclass/ImageSlider.java new file mode 100644 index 0000000..962fe0b --- /dev/null +++ b/app/src/main/java/com/status/truthanddare/modelclass/ImageSlider.java @@ -0,0 +1,13 @@ +package com.status.truthanddare.modelclass; + +public class ImageSlider { + + private final int image; + public ImageSlider(int image) { + this.image = image; + } + public int getImage() { + return image; + } + } + diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/copy_24.xml b/app/src/main/res/drawable/copy_24.xml new file mode 100644 index 0000000..465eebf --- /dev/null +++ b/app/src/main/res/drawable/copy_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/dark_mode_24.xml b/app/src/main/res/drawable/dark_mode_24.xml new file mode 100644 index 0000000..9f2343d --- /dev/null +++ b/app/src/main/res/drawable/dark_mode_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..ca3826a --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/iinst.png b/app/src/main/res/drawable/iinst.png new file mode 100644 index 0000000..771ae98 Binary files /dev/null and b/app/src/main/res/drawable/iinst.png differ diff --git a/app/src/main/res/drawable/img1.png b/app/src/main/res/drawable/img1.png new file mode 100644 index 0000000..7a4f6b7 Binary files /dev/null and b/app/src/main/res/drawable/img1.png differ diff --git a/app/src/main/res/drawable/img2.jpg b/app/src/main/res/drawable/img2.jpg new file mode 100644 index 0000000..db7a255 Binary files /dev/null and b/app/src/main/res/drawable/img2.jpg differ diff --git a/app/src/main/res/drawable/img3.jpg b/app/src/main/res/drawable/img3.jpg new file mode 100644 index 0000000..7e146bd Binary files /dev/null and b/app/src/main/res/drawable/img3.jpg differ diff --git a/app/src/main/res/drawable/img4.jpg b/app/src/main/res/drawable/img4.jpg new file mode 100644 index 0000000..1a695f6 Binary files /dev/null and b/app/src/main/res/drawable/img4.jpg differ diff --git a/app/src/main/res/drawable/language_24.xml b/app/src/main/res/drawable/language_24.xml new file mode 100644 index 0000000..57ebda5 --- /dev/null +++ b/app/src/main/res/drawable/language_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/share_24.xml b/app/src/main/res/drawable/share_24.xml new file mode 100644 index 0000000..bb7d82b --- /dev/null +++ b/app/src/main/res/drawable/share_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/up_24.xml b/app/src/main/res/drawable/up_24.xml new file mode 100644 index 0000000..240f06c --- /dev/null +++ b/app/src/main/res/drawable/up_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/whatshot_24.xml b/app/src/main/res/drawable/whatshot_24.xml new file mode 100644 index 0000000..828ab8a --- /dev/null +++ b/app/src/main/res/drawable/whatshot_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..1171bd0 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_bottom_sheet.xml b/app/src/main/res/layout/fragment_bottom_sheet.xml new file mode 100644 index 0000000..ec83188 --- /dev/null +++ b/app/src/main/res/layout/fragment_bottom_sheet.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + +