Skip to content

Commit

Permalink
add new images, delete unwanted files and 🪲 fixes the know bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Suryansh1720001 committed Aug 10, 2023
1 parent cf94733 commit 51420f3
Show file tree
Hide file tree
Showing 66 changed files with 695 additions and 1,584 deletions.
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId 'com.itssuryansh.taaveez'
minSdk 16
targetSdk 33
versionCode 1
versionName "v1.1.1"
versionCode 2
versionName "v1.1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Expand Down
Binary file added app/release/app-release.aab
Binary file not shown.
8 changes: 1 addition & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.itssuryansh.taaveez">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>


<application
Expand Down Expand Up @@ -40,9 +37,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.Setting"
android:exported="false" />
<activity
android:name=".activity.Open_Content"
android:exported="false" />
Expand Down
39 changes: 32 additions & 7 deletions app/src/main/java/com/itssuryansh/taaveez/activity/About.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.itssuryansh.taaveez.activity
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.view.Gravity
Expand All @@ -21,8 +21,9 @@ class About : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
loadDayNight()
loadLocate()
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)
// setContentView(R.layout.activity_about)
Element()

val aboutPage: View = AboutPage(this)
Expand All @@ -31,19 +32,21 @@ class About : AppCompatActivity() {
.setImage(R.mipmap.ic_launcher)
.setDescription(getString(R.string.about_poem))
.addItem(Element().setTitle("Current Version : "+getString(R.string.appVersion)).setGravity(Gravity.CENTER).setOnClickListener {
Toast.makeText(
this@About,
"Current version of App is : " + getString(R.string.appVersion),
Toast.LENGTH_LONG
).show()

Toast.makeText(this@About,getString(R.string.About_version) + getString(R.string.appVersion),Toast.LENGTH_LONG).show()

})
.addGroup("CONNECT WITH US!")
.addEmail("[email protected]")
.addWebsite("https://taaveez.vercel.app/")
.addPlayStore(packageName)
.addTwitter("itssuryanshP")
.addYoutube("UCdjJbti71WN9ILx9774q2PA") //Enter your youtube link here (replace with my channel link)
// .addPlayStore(packageName) //Replace all this with your package name
.addInstagram("_its_s.u.r.y.a.n.s.h") //Your instagram id

.addItem(createCopyright())

.create()

setContentView(aboutPage)
Expand Down Expand Up @@ -76,6 +79,7 @@ class About : AppCompatActivity() {
finish()
}

@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private fun loadDayNight(){
val sharedPreferences=getSharedPreferences("DayNight", Activity.MODE_PRIVATE)
val DayNight= sharedPreferences.getString("My_DayNight","MyDayNight")
Expand All @@ -97,4 +101,25 @@ class About : AppCompatActivity() {
}
}


private fun loadLocate(){
val sharedPreferences=getSharedPreferences("Setting", Activity.MODE_PRIVATE)
val language= sharedPreferences.getString("My_Lang","MyLang")
if (language != null) {
setLocate(language)
}
}

private fun setLocate(Lang: String) {
val locale = Locale(Lang)
Locale.setDefault(locale)
val config = Configuration()
config.locale = locale
baseContext.resources.updateConfiguration(config,baseContext.resources.displayMetrics)
val editor = getSharedPreferences("Setting", Context.MODE_PRIVATE).edit()
editor.putString("My_Lang",Lang)
editor.apply()
}


}
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
package com.itssuryansh.taaveez.activity

import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.graphics.Color
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.provider.MediaStore
import android.text.*
import android.util.Log
import android.util.TypedValue
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.widget.*
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.view.isNotEmpty
import androidx.lifecycle.lifecycleScope
import com.google.android.material.snackbar.Snackbar
import com.itssuryansh.taaveez.TaaveezApp
Expand Down Expand Up @@ -58,6 +48,14 @@ class Add_New_Content : AppCompatActivity() {
binding = ActivityAddNewContentBinding.inflate(layoutInflater)
setContentView(binding?.root)

// Set the status bar color to white
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window.statusBarColor = getColor(R.color.status_bar_color)
}
}


setupActionBar()
val NotesDao = (application as TaaveezApp).db.TaaveezDao()
AddContent(NotesDao)
Expand All @@ -75,11 +73,10 @@ class Add_New_Content : AppCompatActivity() {
val binding = DialogBinding.inflate(layoutInflater)
BackDialog.setContentView(binding.root)

binding?.dialogImage?.setImageResource(R.drawable.iv_setting)
binding?.tvDialogHeading?.text = "Select Status for Content"
binding?.btnBackNo?.text = "Complete"
binding?.btnBackYes?.text = "Panding"

binding?.dialogImage?.setImageResource(R.drawable.iv_image_3)
binding?.tvDialogHeading?.text = getString(R.string.select_status_for_content)
binding?.btnBackNo?.text = getString(R.string.Complete)
binding?.btnBackYes?.text = getString(R.string.pending)

binding?.btnBackNo?.setOnClickListener {
isContentCompleteStatus = true
Expand All @@ -93,15 +90,7 @@ class Add_New_Content : AppCompatActivity() {
BackDialog.show()
}

private fun takePhotoFromCamera() {
Toast.makeText(this@Add_New_Content,"Choose photo from camera",Toast.LENGTH_LONG).show()
}

private fun choosePhotoFromGallery() {
// requestStoragePermission()
Toast.makeText(this@Add_New_Content,"Choose photo from gallery",Toast.LENGTH_LONG).show()

}



Expand Down Expand Up @@ -339,10 +328,17 @@ class Add_New_Content : AppCompatActivity() {


private fun BackData() {


val BackDialog = Dialog(this)
BackDialog.setCancelable(false)
val binding = DialogBinding.inflate(layoutInflater)
BackDialog.setContentView(binding.root)

binding?.dialogImage?.setImageResource(R.drawable.iv_image_5)
binding?.tvDialogHeading?.text = getString(R.string.discard_changes)


binding?.btnBackNo?.setOnClickListener {
BackDialog.dismiss()
}
Expand All @@ -351,8 +347,8 @@ class Add_New_Content : AppCompatActivity() {
super.onBackPressed()
overridePendingTransition(R.drawable.slide_in_right, R.drawable.slide_out_left)
}

BackDialog.show()
}


}
27 changes: 19 additions & 8 deletions app/src/main/java/com/itssuryansh/taaveez/activity/Edit_Content.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class Edit_Content : AppCompatActivity() {

TaaveezDao = (application as TaaveezApp).db.TaaveezDao()

// Set the status bar color to white
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window.statusBarColor = getColor(R.color.status_bar_color)
}
}

binding?.UpdateisComplete?.setOnClickListener{
openDialogForStatus()
Expand Down Expand Up @@ -109,7 +115,6 @@ class Edit_Content : AppCompatActivity() {

// setUP the content in the editview and richeditor from the Database
lifecycleScope.launch {

TaaveezDao.fetchContentsById(id!!).collect {
if (it != null) {
binding?.etPoemTopic?.setText(it.Topic)
Expand All @@ -119,7 +124,6 @@ class Edit_Content : AppCompatActivity() {

}
}

}

// edit text - topic lenght size limit
Expand Down Expand Up @@ -166,10 +170,10 @@ class Edit_Content : AppCompatActivity() {
val binding = DialogBinding.inflate(layoutInflater)
BackDialog.setContentView(binding.root)

binding?.dialogImage?.setImageResource(R.drawable.iv_setting)
binding?.tvDialogHeading?.text = "Select Status for Content"
binding?.btnBackNo?.text = "Complete"
binding?.btnBackYes?.text = "Panding"
binding?.dialogImage?.setImageResource(R.drawable.iv_image_3)
binding?.tvDialogHeading?.text = getString(R.string.select_status_for_content)
binding?.btnBackNo?.text = getString(R.string.Complete)
binding?.btnBackYes?.text = getString(R.string.pending)


binding?.btnBackNo?.setOnClickListener {
Expand Down Expand Up @@ -223,7 +227,7 @@ class Edit_Content : AppCompatActivity() {
if (!(TextUtils.isEmpty(Topic.trim { it <= ' ' }))) {
lifecycleScope.launch {
TaaveezDao.update(TaaveezEntity(id!!, Topic, Description, date,CreatedDate, smalldes, isComplete = isContentCompleteStatus!!,favorite=false))
Toast.makeText(applicationContext, "Record Updated", Toast.LENGTH_LONG)
Toast.makeText(applicationContext, getString(R.string.record_updated), Toast.LENGTH_LONG)
.show()
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK

Expand All @@ -232,7 +236,7 @@ class Edit_Content : AppCompatActivity() {
Topic = "दुआ"
lifecycleScope.launch {
TaaveezDao.update(TaaveezEntity(id!!, Topic, Description, date, CreatedDate, smalldes,isComplete = isContentCompleteStatus!!,favorite=false))
Toast.makeText(applicationContext, "Record Updated", Toast.LENGTH_LONG)
Toast.makeText(applicationContext, getString(R.string.record_updated), Toast.LENGTH_LONG)
.show()
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK

Expand Down Expand Up @@ -313,6 +317,11 @@ class Edit_Content : AppCompatActivity() {
BackDialog.setCancelable(false)
val binding = DialogBinding.inflate(layoutInflater)
BackDialog.setContentView(binding.root)

binding?.dialogImage?.setImageResource(R.drawable.iv_image_5)
binding?.tvDialogHeading?.text = getString(R.string.discard_changes)


binding?.btnBackNo?.setOnClickListener {
BackDialog.dismiss()
}
Expand All @@ -321,7 +330,9 @@ class Edit_Content : AppCompatActivity() {
super.onBackPressed()
overridePendingTransition(R.drawable.slide_in_left, R.drawable.slide_out_rigth)
}

BackDialog.show()

}

override fun onBackPressed() {
Expand Down
Loading

0 comments on commit 51420f3

Please sign in to comment.