Skip to content

Instantly share code, notes, and snippets.

@AswinpAshok
Created October 23, 2017 05:54
Show Gist options
  • Select an option

  • Save AswinpAshok/d41cf54fa676cb59350f6e8b2dc8a59d to your computer and use it in GitHub Desktop.

Select an option

Save AswinpAshok/d41cf54fa676cb59350f6e8b2dc8a59d to your computer and use it in GitHub Desktop.

Revisions

  1. AswinpAshok created this gist Oct 23, 2017.
    59 changes: 59 additions & 0 deletions Global.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    package com.sandftechnologies.schoolmanagementStaff.ModelClasses

    import android.app.Application
    import android.content.Context
    import android.content.SharedPreferences
    import android.graphics.Typeface
    import android.widget.ArrayAdapter

    import com.facebook.drawee.backends.pipeline.Fresco
    import com.sandftechnologies.schoolmanagementStaff.Activities.ViewStudent
    import com.sandftechnologies.schoolmanagementStaff.DataCache
    import com.sandftechnologies.schoolmanagementStaff.HelperClass.DBHelper
    import com.sandftechnologies.schoolmanagementStaff.Internet.GlobalVariables

    /**
    * Created by PC4 on 5/6/2017.
    */

    class Global : Application(), GlobalVariables {


    override fun onCreate() {
    super.onCreate()
    Fresco.initialize(this)
    student = StudentCompleteModel()

    typeface = Typeface.createFromAsset(assets, "fonts/Roboto-Light.ttf")
    typefaceBold = Typeface.createFromAsset(assets, "fonts/Roboto-Regular.ttf")
    val dbHelper = DBHelper.getInstance(this)
    mDatacache = DataCache.getInstance()
    val shared = getSharedPreferences(GlobalVariables.Shared_Pref_Name, Context.MODE_PRIVATE)
    userID = shared.getString("userID", "")
    firmID = shared.getString("firmID", "")

    }

    companion object {
    //ClassId,RegDate---, flag=0-->details[Name,id,Roll,attendance[0,1,a,p]]
    //flag=1-->+Atd_Id
    var CategoryAdapter: ArrayAdapter<String>? = null
    var SelectedCategoryPosition: Int = 0

    var isStudentLoaded = false
    var student :StudentCompleteModel ?=null/* (Name, Rollnumber, MobileNumber, FatherName, MotherName, Email, DoB, Gender, Religion, Cast, CategoryName, Profilepic, S_Addressline1, S_Addressline2, S_AddressPIN, P_AddressLine1, P_AddressLine2, P_AddressPIN, Id, ClassId, ClassName, AddressFlag, Date_Admsn, Standard_Admited, Identification, Is_Former, Former_Madrasa, MadrasaRegNo, Tc_Number, Guardian_Name, G_AddressLine1, G_AddressLine2, G_AddressPIN, G_Relation, G_Occupation, AdmissionNumber) =*/
    var CategoryMap: Map<String, Int>? = null
    var typeface: Typeface? = null
    private set
    var typefaceBold: Typeface? = null
    private set

    private var mDatacache: DataCache? = null
    var userID: String? = null
    private set
    var firmID: String? = null
    private set
    }


    }