Document From Manishkumar
Document From Manishkumar
THIM TRUST'S
THEEM COLLEGE OF ENGINEERING
A
CAPSTONE PROJECT
REPORT ON
“CHATGPT APP CLONE USING ANDROID
DEVELOPMENT”
PROJECT WORK SUBMITTED IN PARTIAL FULFILLMENT
OF
THE REQUIREMENTS FOR THE AWARD OF DIPLOMA.
SUBMITTED BY
Certificate
This is to certify that the report has been submitted by following students
This project work has been completed by Final Year Students Of course Computer
Department having title Health Care Management System during the academic year
2023-2024. This project was completed in a group consisting of four people under the
guidance of the Faculty Guide.
We declare that this written submission represents our ideas in our own words
and where others’ ideas or words have been included. We have adequately cited
and referenced the original sources. We also declared that we adhered to all
principals of academics honestly and integrity have not misrepresented or
fabricated or falsified any idea/data/fact sources in our submission. We
understand that any violation of the above will be cause for disciplinary action by
the institute and can also evoke penal action from the source which has thus not
been properly cited from whom proper permission has not been taken when
needed.
1.ANIS KHAN
2.MANISH KUMAR
3.HIMANSHU SATOTE
4.MOHAMMAD MEMON
ACKNOWLEDGEMENT
The success and final outcome of this project required a lot of guidance
and assistance from many people, and we are extremely privileged to have all this
along the completion of our project. All that we have accomplished is only due to
such supervision and assistance and we would not forget to thank them.
We owe our deep gratitude to our project guide Prof. Sarika Patil who
took keen interest in our project work and guided us all along, till the completion
of our project by providing all the necessary information for developing a good
system.
___________
ANIS KHAN
______________
MANISH KUMAR
_________________
HIMANSHU SATOTE
_________________
MOHAMMAD MEMON
TABLE OF CONTENTS
SR.NO TITLE
1. ABSTRACT
INTRODUCTION
2. SYSTEM INTRODUCTION
3. TOOLS INTRODUCTION
4. TECHNOLOGY INTRODUCTION
MODULES
5. ANDROID APP MODULE
6. FEATURE MODULE
7. LIBRARY MODULE
ABOUT THE PROJECT
8. PROBLEM STATEMENT
9. ABOUT PROJECT
10. SYATEM FEATURE
SYSTEM IMPLEMENTATAION
11. SETUP PROCESS
12. HOW TO INSTALL
13. PROJECT STRUCTURE SETTINGS
SOURCE CODE
14. CODE
CONCLUSION
ABSTRACT
The Pi Chat app is an innovative Android application designed to provide users with a
personalized conversational experience. Built on the GPT-3.5 architecture, a large language
model trained by OpenAI, this app is capable of understanding natural language input and
generating contextually relevant and engaging responses.
The app is highly user-friendly and can be easily customized to suit individual preferences.
Users have the option to choose from a variety of conversational styles and themes, allowing
them to personalize the app according to their liking. Additionally, the app includes a feature
that enables users to save their favourite conversations for future reference, making it
convenient to revisit and continue discussions.
With an intuitive and clean interface, the Pi Chat app offers a seamless navigation experience
for users on their Android devices. Overall, the Pi Chat app represents a significant
advancement in artificial intelligence and mobile app development, providing users with a
unique and entertaining conversational experience tailored to their preferences.
INTRODUCTION
What is Pi Chat?
Pi Chat represents an innovative conversational AI model developed by OpenAI, leveraging
advanced machine learning techniques. It is based on the GPT (Generative Pre-trained
Transformer) architecture, which has been trained on vast amounts of text data to understand
and generate natural language responses. Key features of Pi Chat include:
Language Understanding: Pi Chat can comprehend natural language inputs from users, ranging
from simple queries to complex conversations, through its trained language model.
Response Generation: Using its trained model, Pi Chat generates contextually relevant and
human-like responses, ensuring engaging and meaningful interactions.
Contextual Awareness: The AI model of Pi Chat maintains contextual awareness during
conversations, allowing for coherent and relevant dialogue flows.
Customization: Pi Chat can be customized and fine-tuned to cater to specific use cases,
industries, or user preferences, enhancing its adaptability and utility.
TOOLS USED
1. Android Studio
Android Studio is the official Integrated Development Environment (IDE) for android
application development. Android Studio provides more features that enhance our productivity
while building Android apps.
2. GOOGLE SERVICES
To integrate Google sign-in functionality into your ChatGPT clone application for Android
development, you can use Google Sign in for Android, which is a library provided by Google
that makes it easy to integrate Google sign in functionality into your Android app
Step1: Create a new project in the Firebase console, if you haven't already. Follow the
instructions provided by Firebase to set up your project.
Step2: Add the Firebase Android configuration file to your app. You can do this by following
the instructions provided by Firebase
Step3: Add the Google Play services library to your app. You can do this by adding the
following dependency to your app's build. Gradle file
Step9: Handle the result of the sign-inflow in the Activity Rault) method
Step10: Finally, implement the handlesigninResult () method to handle the result of the sign-
in flow
To use Google APIs in your ChatGPT clone application for Android development, you need to
follow the following steps:
Step2: Enable the APIs that you want to your project. To do this, go to Be API & Services"
section of the console, and chick on "Larry in the left sidebar Them. such for the API that you
want to me (e.g. Google Maps, Google Translate, etc.) and enable it for your project.
Step3: Create an API key for your port to do this, go to the "Ale & Servies action of the console,
and click on "Credentials in the left sidebar. Then click on the "Crate credentials button and
west "API key You can choose between unrestricted or restricted API key. A restricted API key
let you at the age of the APT key to specify applications or websites, while an unrestricted API
key can be man by any application or website
step4: Add the API key to your Chatigit clone application. To do this, add the following code
to your AndroidManifest.xml file
Step5: le the Google API were in your ChatGPT clone application You can save the Apls in
your application by calling the appropriate API cathode is your male. Put example, if you want
to use the Google Maps API to display a map in your application you can add a Map View and
then the Google Map lever to add markers, polylines, etc. to the map
Here are a few examples of how to use some common Google APIs in your ChatGPT clone
application:
Google Maps API: Use the Map View to display a map in your application. You can then use
the Google Map object to add markers, polylines, etc. to the map
Google Places API: Use the AutocompleteTextView to provide autocomplete suggestions for
places as the user types. You can also use the Places API to Search for places based on a user's
location or a search query
Google Translate API: Use the Translate API to translate text from one language to another
Google Cloud Vision API: Use the Vision API to analyze images and detect objects, faces,
text, and other features.
1. GPT-3 API: This API provides access to OpenAI's flagship language model, GPT-3. It can
generate natural language text, translate languages, answer questions, and more
2. DALLE API: This API allows users to generate images from natural language descriptions.
It is based on Open Al’s DALLE model, which can create a wide range of images
3. Codes API: This API provides a natural language interface to Open Al’s GPT 3 model for
coding related tasks. It can assist with coding, debugging, and even generate code from plain
English descriptions
4. CLIP API: This API is based on Open Al’s Contrastive Language-Image Pretraining (CLIP)
model, which can understand the relationship between images and language It can be used for
tasks like image search and classification
5. Open Al API: This API provides access to several other OpenAl models, including GPT-2
and the image captioning model
MODULES
A module is a collection of source files and build settings that let you divide your project into
discrete units of functionality Your project can have one or many modules, and one module can
use another module as a dependency. You can independently build, test, and debug each module
Provides a container for your app's sources code, resource files, and app-level settings. such as
the module-level build file and Android Manifest file. When you create a new project, the
default app module is named "app"
In the Create New Module window, Android Studio offers the following types of app modules
Feature module
Represents a modularized feature of your app that can take advantage of Flay Feature Delivery
For example with feature modules, you can provide your users with certain features of your
app on demand or as instant experiences through Google Play Instant
Dynamic Feature Module: - Dynamic feature modules allow you to separate certain
features and resources from the base module of your app and include them in your app
bundle. Through Dynamic Delivery, users can later download and install those
components on demand after they've already installed the base APK of your app.
Android Library: This type of library can contain all file types supported in an Android
project except native C++ code, including Java and Kotlin source code, resources, and manifest
files. The build result is an Android Archive (AAR) file that you can add as a dependency for
your Android app modules
Android Native Library: This type of library can contain all Be types supported in an Android
project similar to an Android Library However Android Native Libraries also can contain
native C++ sourer code The build result is an Android Archive (AAR) file that you can add as
a dependency for your Android app modules
Java or Kotlin Library: This type of library contains only Kotlin or Java source files. The
build result is a Java Archive (JAR) file that you can add as a dependency for your Android
app modules or other Kotlin or Java projects
ABOUT THE PROJECT
The Pi Chat app project aims to create an intuitive and interactive conversational AI platform
for Android devices. Key components and aspects of the project include:
o User Interface Design: Designing a user-friendly and visually appealing interface for
the Pi Chat app, including chat bubbles, input fields, multimedia support, and
interactive elements.
o Machine Learning and Training: Training the Pi Chat model on diverse datasets to
improve language understanding, response generation, context retention, and
conversational capabilities.
o Deployment and Distribution: Deploying the Pi Chat app on Google Play Store or
other distribution platforms, ensuring scalability, performance optimization, and
continuous updates.
o User Feedback and Iteration: Collecting user feedback, analysing usage patterns, and
iterating on the app's features, functionalities, and AI model to enhance user satisfaction
and engagement.
The Pi Chat project addresses several challenges and objectives related to conversational AI
and mobile app development:
Machine Learning and Training: Training the Pi Chat model for improved
conversational capabilities and response quality.
Analytics and Reporting: Analytics tools to monitor usage, performance, and user
interactions.
The implementation process for the Pi Chat app project encompasses various stages,
methodologies, and best practices:
Requirements Elicitation and Analysis: Conducting stakeholder interviews, user
surveys, market research, and requirements gathering sessions to define project
objectives, scope, functionalities, and user stories.
Architecture and Design: Designing system architecture, data models, UI/UX
wireframes, interaction flows, component diagrams, and API integrations based on
identified requirements and design principles.
Development and Coding: Writing clean, modular, and scalable code using best
practices, coding standards, design patterns, and version control systems. Implementing
features, functionalities, algorithms, and AI models as per specifications.
Testing and Quality Assurance: Performing rigorous testing, including unit testing,
integration testing, regression testing, usability testing, and AI model evaluation.
Identifying bugs, issues, edge cases, and performance bottlenecks for resolution.
Deployment and Release: Deploying the Pi Chat app on staging environments, beta
testing groups, production servers, or app stores. Managing deployment pipelines,
configuration settings, release cycles, and version updates.
User Training and Onboarding: Providing user guides, tutorials, help documentation,
tooltips, and onboarding experiences to educate users, familiarize them with app
features, and enhance user adoption.
Monitoring and Maintenance: Monitoring app performance, user feedback, crash
reports, analytics data, and system logs. Conducting regular maintenance, bug fixes,
security patches, and updates to ensure app reliability, availability, and security.
This comprehensive approach ensures the successful development, deployment, and
ongoing enhancement of the Pi Chat app, providing users with an immersive,
intelligent, and interactive conversational AI platform on Android devices.
How To Install Android Studio:
Step 1: Go To the Official Website of the Android Studio
Step 2: Click on the Download Android Studio Button
Click on the "I have read and agree with the above terms and conditions" checkbox followed
by the download button.
Click on the Save file button in the appeared prompt box and the file will start downloading.
Step 3: After the downloading has finished, open the file from downloads and run it. It will
prompt the following dialog box.
Click on next. In the next prompt, it'll ask for a path for installation. Choose a path and hit next.
Step 4: It will start the installation, and once it is completed, it will be like the image shown
below.
Click on next.
Step 5: Once "Finish" is clicked, it will ask whether the previous settings need to be imported
[if the android studio had been installed earlier], or not. It is better to choose the 'Don't import
Settings option
Step 6: Once "Finish" is clicked, it will ask whether the previous settings need to be imported
[if the android studio had been installed earlier), or not. It is better to choose the Don't import
Settings option
Meanwhile, it will be finding the available SDK components.
Step 7: After it has found the SDK components, it will redirect to the Welcome dialog box
Click on Next
Choose Standard and click on Next. Now choose the theme, whether the Light theme or the
Dark one. The light one is called the IntelliJ theme whereas the dark theme is called Dracula
Choose as required.
Click on the Next button.
Step 8: Now it is time to download the SDK components
Click on Finish Components begin to download let it complete
The Android Studio has been successfully configured. Now it's time to launch and build apps.
Chek on the Finish button to launch it
Step 9: Click on Start a new Android Studio project to build a new app
Project structure settings
To change various settings for your Android Studio project, open the Project Structure dialog
by clicking File > Project Structure. It contains the following sections:
Project: Sets the version for Gradle and the Android Gradle plugin and the repository location
name.
SDK Location: Sets the location of the JDK, Android SDK, and Android NDK that your
project uses.
Variables: Lets you edit variables that are used within your build scripts.
Modules: Lets you edit module-specific build configurations, including the target and
minimum SDK, the app signature, and library dependencies. Each module's settings page is
divided into the following tabs:
Properties: Specifies the versions of the SDK and build tools to use to compile the module.
Signing: Specifies the certificate to use to sign your app.
Dependencies: Lists the library, file, and module dependencies for this module. You can add,
modify, and delete dependencies from this pane. For more information about module
dependencies, see Configure build variants.
Preview: If you're using a version catalog, be aware of the issue that dependencies added
through the Project Structure dialog are added to the module's build. Gradle file, not the
catalog. To learn more about Gradle Version Catalogs support in Android Studio, see
the preview release note.
Build Variants: Lets you configure different flavors and build types for your project.
Flavors: Lets you create multiple build flavors, where each flavor specifies a set of
configuration settings, such as the module's minimum and target SDK version and the version
code and version name.
For example, you might define one flavor that has a minimum SDK of 21 and a target SDK of
29, and another flavor that has a minimum SDK of 24 and a target SDK of 33.
Build Types: Lets you create and modify build configurations, as described in Configure build
variants. By default, every module has debug and release build types, and you can define more
as needed.
SOURCE CODE
MAIN ACTIVITY
package com.infiapp.webapp
import android.annotation.SuppressLint
import android.app.AlertDialog
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Configuration
import android.os.*
import android.util.Log
import android.view.MenuItem
import android.view.View
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.Button
import android.widget.ImageView
import android.widget.Switch
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.view.GravityCompat
import androidx.navigation.ui.AppBarConfiguration
import com.google.android.gms.ads.*
import com.google.android.gms.ads.interstitial.InterstitialAd
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
import com.google.android.material.navigation.NavigationView
import com.infiapp.webapp.databinding.ActivityMainBinding
@RequiresApi(Build.VERSION_CODES.M)
@SuppressLint("ResourceType")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
supportActionBar?.hide()
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
loadBannerAd()
loadInterAd()
binding.textview.text = "Home"
mContext = this
shared = Shared(this)
if (isChecked) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
editor.putBoolean(LIGHT_MODE, false)
editor.putBoolean(NIGHT_MODE, true)
editor.apply()
//recreate activity to make changes visible
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
editor.putBoolean(LIGHT_MODE, true)
editor.putBoolean(NIGHT_MODE, false)
editor.apply()
}
Log.e("1111", "onCreate: "+isChecked )
}
reference()
binding.navView.setNavigationItemSelectedListener(this)
binding.webView.webViewClient = MyWebViewClient(this)
binding.webView.loadUrl(resources.getString(R.string.main_url))
binding.webView.settings.javaScriptEnabled = true
binding.navigation.setOnClickListener {
if (binding.drawerLayout.isDrawerOpen(GravityCompat.START)) {
binding.drawerLayout.closeDrawer(GravityCompat.START)
} else {
binding.drawerLayout.openDrawer(GravityCompat.START)
}
}
binding.search.setOnClickListener {
binding.webView.webViewClient = MyWebViewClient(this)
binding.webView.loadUrl(resources.getString(R.string.home_url))
}
}
binding.adView.loadAd(adRequest)
@RequiresApi(Build.VERSION_CODES.M)
override fun onNavigationItemSelected(item: MenuItem): Boolean {
when (item.getItemId()) {
R.id.nav_home -> {
showInterAd(this)
binding.textview.setText(resources.getString(R.string.menu_home))
binding.webView.visibility=View.VISIBLE
binding.aboutUsText.visibility=View.GONE
binding.colorLinear.visibility=View.GONE
binding.webView.webViewClient = MyWebViewClient(this)
binding.webView.loadUrl(resources.getString(R.string.home_url))
}
R.id.nav_message -> {
showInterAd(this)
binding.textview.setText(resources.getString(R.string.menu_message))
binding.webView.visibility=View.VISIBLE
binding.aboutUsText.visibility=View.GONE
binding.colorLinear.visibility=View.GONE
binding.webView.webViewClient = MyWebViewClient(this)
binding.webView.loadUrl(resources.getString(R.string.message_url))
}
R.id.nav_filter -> {
showInterAd(this)
binding.textview.setText(resources.getString(R.string.menu_filter))
binding.webView.visibility=View.VISIBLE
binding.aboutUsText.visibility=View.GONE
binding.colorLinear.visibility=View.GONE
binding.webView.webViewClient = MyWebViewClient(this)
binding.webView.loadUrl(resources.getString(R.string.filter_url))
}
R.id.nav_changecolor -> {
val sharedPreferences = getSharedPreferences("sharedPrefs", MODE_PRIVATE)
val isDarkModeOn = sharedPreferences.getBoolean("isDarkModeOn", false)
if (isDarkModeOn) {
binding.textview.setText(resources.getString(R.string.menu_change_theme_color))
binding.webView.visibility=View.GONE
binding.aboutUsText.visibility=View.GONE
binding.colorLinear.visibility=View.VISIBLE
binding.search.visibility=View.VISIBLE
binding.search.setImageDrawable(getDrawable(R.drawable.check_24))
binding.search.setOnClickListener {
reference()
onClick()
val intent = Intent(applicationContext, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
startActivity(intent)
}
}
}
R.id.nav_darkmode->{
}
R.id.nav_aboutus-> {
showInterAd(this)
binding.textview.setText(resources.getString(R.string.menu_about_us))
binding.aboutUsText.visibility=View.VISIBLE
binding.webView.visibility=View.GONE
binding.search.visibility=View.GONE
binding.colorLinear.visibility=View.GONE
}
R.id.nav_exit-> {
backPress()
}
}
binding.drawerLayout.closeDrawer(GravityCompat.START)
return true
}
private fun reference() {
view1 = findViewById<View>(R.id.view1)
view2 = findViewById<View>(R.id.view2)
view3 = findViewById<View>(R.id.view3)
view4 = findViewById<View>(R.id.view4)
view5 = findViewById<View>(R.id.view5)
view6 = findViewById<View>(R.id.view6)
view7 = findViewById<View>(R.id.view7)
view8 = findViewById<View>(R.id.view8)
view9 = findViewById<View>(R.id.view9)
view10 = findViewById<View>(R.id.view10)
view11 = findViewById<View>(R.id.view11)
view12 = findViewById<View>(R.id.view12)
view13 = findViewById<View>(R.id.view13)
view14 = findViewById<View>(R.id.view14)
view15 = findViewById<View>(R.id.view15)
view16 = findViewById<View>(R.id.view16)
view17 = findViewById<View>(R.id.view17)
view18 = findViewById<View>(R.id.view18)
view19 = findViewById<View>(R.id.view19)
view20 = findViewById<View>(R.id.view20)
img1!!.visibility = View.VISIBLE
init()
}
private fun init() {
if(shared!!.getSetThemeColor().contentEquals("BG")) {
setTickBG()
} else if (shared!!.getSetThemeColor().contentEquals("TEAL")) {
setTickTEAL()
} else if (shared!!.getSetThemeColor().contentEquals("BLUE")) {
setTickBLUE()
} else if (shared!!.getSetThemeColor().contentEquals("DEEP_ORANGE")) {
setDeeporange() }
else if (shared!!.getSetThemeColor().contentEquals("YELLOW")) {
setTickYellow() }
else if (shared!!.getSetThemeColor().contentEquals("INDIGO")) {
setTickINDiGO() }
else if (shared!!.getSetThemeColor().contentEquals("GREEN")) {
setTickGreen() }
else if (shared!!.getSetThemeColor().contentEquals("ORANGE")) {
setTickOrange()
} else if (shared!!.getSetThemeColor().contentEquals("CYN")) {
setTickCyn()
} else if (shared!!.getSetThemeColor().contentEquals("PINK")) {
setTickPink()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR2")) {
setTickColor2()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR3")) {
setTickColor3()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR4")) {
setTickColor4()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR5")) {
setTickColor5()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR6")) {
setTickColor6()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR7")) {
setTickColor7()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR8")) {
setTickColor8()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR9")) {
setTickColor9()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR10")) {
setTickColor10()
} else if (shared!!.getSetThemeColor().contentEquals("COLOR11")) {
setTickColor11()}
}
private fun setTickBG() {
img1!!.visibility = View.VISIBLE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickTEAL() {
img1!!.visibility = View.GONE
img2!!.visibility = View.VISIBLE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickBLUE() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.VISIBLE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setDeeporange() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.VISIBLE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickGreen() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.VISIBLE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickYellow() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.VISIBLE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickINDiGO() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.VISIBLE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickOrange() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.VISIBLE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickCyn() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.VISIBLE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickPink() {
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.VISIBLE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor2(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.VISIBLE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor3(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.VISIBLE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor4(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.VISIBLE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor5(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.VISIBLE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor6(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.VISIBLE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor7(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.VISIBLE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor8(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.VISIBLE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor9(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.VISIBLE
img19!!.visibility = View.GONE
img20!!.visibility = View.GONE
}
private fun setTickColor10(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.VISIBLE
img20!!.visibility = View.GONE
}
private fun setTickColor11(){
img1!!.visibility = View.GONE
img2!!.visibility = View.GONE
img3!!.visibility = View.GONE
img4!!.visibility = View.GONE
img5!!.visibility = View.GONE
img6!!.visibility = View.GONE
img7!!.visibility = View.GONE
img8!!.visibility = View.GONE
img9!!.visibility = View.GONE
img10!!.visibility = View.GONE
img11!!.visibility = View.GONE
img12!!.visibility = View.GONE
img13!!.visibility = View.GONE
img14!!.visibility = View.GONE
img15!!.visibility = View.GONE
img16!!.visibility = View.GONE
img17!!.visibility = View.GONE
img18!!.visibility = View.GONE
img19!!.visibility = View.GONE
img20!!.visibility = View.VISIBLE
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
1))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R1))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK1)
}
} else if (shared!!.getSetThemeColor().contentEquals("TEAL")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.TEAl))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.TEAl))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_TEAL) } }
else if (shared!!.getSetThemeColor().contentEquals("BLUE")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.BLUE))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.BLUE
))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_BLUE) }
}
else if (shared!!.getSetThemeColor().contentEquals("DEEP_ORANGE")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.ORANG
E))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.ORAN
GE))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_DEEP_ORANGE)
}
} else if (shared!!.getSetThemeColor().contentEquals("YELLOW")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.yellow))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.yellow
))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = ContextCompat.getColor(mContext!!,R.color.yellow)
}
} else if (shared!!.getSetThemeColor().contentEquals("INDIGO")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.INDIG
O))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.INDI
GO))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = ContextCompat.getColor(mContext!!,R.color.INDIGO)
}
} else if (shared!!.getSetThemeColor().contentEquals("GREEN")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.GREEN
))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.GREE
N))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = ContextCompat.getColor(mContext!!,R.color.GREEN)
}
} else if (shared!!.getSetThemeColor().contentEquals("ORANGE")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.ORANG
E))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.ORAN
GE))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_ORANGE)
}
} else if (shared!!.getSetThemeColor().contentEquals("CYN")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.CYN))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.CYN))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_CYN)
}
} else if (shared!!.getSetThemeColor().contentEquals("PINK")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.PINK))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.PINK)
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.DARK_PINK)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR2")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
2))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R2))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK2)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR3")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
3))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R3))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK3)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR4")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
4))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R4))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK4)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR5")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
5))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R5))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK5)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR6")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
6))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R6))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK6)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR7")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
7))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R7))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK7)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR8")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
8))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R8))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK8)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR9")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
9))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R9))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK9)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR10")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
10))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R10))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK10)
}
}
else if (shared!!.getSetThemeColor().contentEquals("COLOR11")) {
binding.toolbar.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLOR
11))
binding.navView.setBackgroundColor(ContextCompat.getColor(mContext!!,R.color.COLO
R11))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor =
ContextCompat.getColor(mContext!!,R.color.COLORDARK11)
}
}
onClick()
}
private fun onClick() {
view1?.setOnClickListener {
view1!!.visibility=View.VISIBLE
shared?.SetThemeColor("BG")
setTickBG()
//setActionBar()
}
view2?.setOnClickListener {
view1!!.visibility=View.VISIBLE
shared?.SetThemeColor("TEAL")
setTickTEAL()
//setActionBar()
}
view3?.setOnClickListener {
view3!!.visibility=View.VISIBLE
shared?.SetThemeColor("BLUE")
setTickBLUE()
//setActionBar()
}
view4?.setOnClickListener {
view4!!.visibility=View.VISIBLE
shared?.SetThemeColor("DEEP_ORANGE")
setDeeporange()
//setActionBar()
}
view5?.setOnClickListener {
view5!!.visibility=View.VISIBLE
shared?.SetThemeColor("GREEN")
setTickGreen()
// setActionBar()
}
view6?.setOnClickListener {
view6!!.visibility=View.VISIBLE
shared?.SetThemeColor("YELLOW")
setTickYellow()
// setActionBar()
}
view7?.setOnClickListener {
view7!!.visibility=View.VISIBLE
shared?.SetThemeColor("INDIGO")
setTickINDiGO()
// setActionBar()
}
view8?.setOnClickListener {
view8!!.visibility=View.VISIBLE
shared?.SetThemeColor("ORANGE")
setTickOrange()
// setActionBar()
}
view9?.setOnClickListener {
view9!!.visibility=View.VISIBLE
shared?.SetThemeColor("CYN")
setTickCyn()
// setActionBar()
}
view10?.setOnClickListener {
view10!!.visibility=View.VISIBLE
shared?.SetThemeColor("PINK")
setTickPink()
// setActionBar()
}
view11?.setOnClickListener {
view11!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR2")
setTickColor2()
// setActionBar()
}
view12?.setOnClickListener {
view12!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR3")
setTickColor3()
// setActionBar()
}
view13?.setOnClickListener {
view13!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR4")
setTickColor4()
// setActionBar()
}
view14?.setOnClickListener {
view14!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR5")
setTickColor5()
// setActionBar()
}
view15?.setOnClickListener {
view15!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR6")
setTickColor6()
// setActionBar()
}
view16?.setOnClickListener {
view16!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR7")
setTickColor7()
// setActionBar()
}
view17?.setOnClickListener {
view17!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR8")
setTickColor8()
// setActionBar()
}
view18?.setOnClickListener {
view18!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR9")
setTickColor9()
// setActionBar()
}
view19?.setOnClickListener {
view19!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR10")
setTickColor10()
// setActionBar()
}
view20?.setOnClickListener {
view20!!.visibility=View.VISIBLE
shared?.SetThemeColor("COLOR11")
setTickColor11()
// setActionBar()
}
}
fun showInterAd(context: Context) {
sharedPreferences = context?.getSharedPreferences("sharedPrefs",
AppCompatActivity.MODE_PRIVATE)
counter = sharedPreferences!!.getInt("count", 0)
counter += 1
if (counter == 5) {
editor.putInt("count", 0)
editor.apply()
if (mInterstitialAd != null) {
mInterstitialAd!!.show(this)
mInterstitialAd!!.fullScreenContentCallback = object :
FullScreenContentCallback() {
}
else
{
Log.e("111111", "showInterAd: fail")
}
}
}
fun loadInterAd() {
}
override fun onAdLoaded(interstitialAd: InterstitialAd) {
Log.e("111111", "onAdLoaded: ")
mInterstitialAd = interstitialAd
}
})
}
}
@RequiresApi(Build.VERSION_CODES.M)
@SuppressLint("ResourceType")
if (binding.webView!!.canGoBack()) {
binding.webView.goBack()
} else {
super.onBackPressed()
}
}