messenger-android

Android graphical user interfaces for GNUnet Messenger
Log | Files | Refs | README | LICENSE

BaseProfileFragment.kt (2529B)


      1 /*
      2    This file is part of GNUnet.
      3    Copyright (C) 2021--2025 GNUnet e.V.
      4 
      5    GNUnet is free software: you can redistribute it and/or modify it
      6    under the terms of the GNU Affero General Public License as published
      7    by the Free Software Foundation, either version 3 of the License,
      8    or (at your option) any later version.
      9 
     10    GNUnet is distributed in the hope that it will be useful, but
     11    WITHOUT ANY WARRANTY; without even the implied warranty of
     12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13    Affero General Public License for more details.
     14 
     15    You should have received a copy of the GNU Affero General Public License
     16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18    SPDX-License-Identifier: AGPL3.0-or-later
     19  */
     20 /*
     21  * @author t3sserakt
     22  * @file GNUnetMessenger/app/src/main/java/org/gnunet/gnunetmessenger/ui/BaseProfileFragment.kt
     23  */
     24 
     25 package org.gnunet.gnunetmessenger.ui
     26 
     27 import android.os.Bundle
     28 import android.view.View
     29 import android.widget.Button
     30 import android.widget.EditText
     31 import android.widget.ImageView
     32 import android.widget.TextView
     33 import androidx.fragment.app.Fragment
     34 import org.gnunet.gnunetmessenger.R
     35 
     36 abstract class BaseProfileFragment : Fragment() {
     37 
     38     protected lateinit var avatarImage: ImageView
     39     protected lateinit var nameText: TextView
     40     protected lateinit var nameEdit: EditText
     41     protected lateinit var saveNameButton: Button
     42     protected lateinit var publicKeyText: TextView
     43     protected lateinit var qrCodeImage: ImageView
     44     //protected lateinit var listAttributesButton: Button
     45     protected lateinit var shareAttributesButton: Button
     46     protected lateinit var shareIdentityButton: Button
     47     protected lateinit var blockContactButton: Button
     48 
     49     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
     50         avatarImage = view.findViewById(R.id.avatarImage)
     51         nameText = view.findViewById(R.id.nameText)
     52         nameEdit = view.findViewById(R.id.nameEdit)
     53         saveNameButton = view.findViewById(R.id.btn_save_name)
     54         publicKeyText = view.findViewById(R.id.publicKeyText)
     55         qrCodeImage = view.findViewById(R.id.qrCodeImage)
     56         //listAttributesButton = view.findViewById(R.id.btn_list_attributes)
     57         shareAttributesButton = view.findViewById(R.id.btn_share_attributes)
     58         shareIdentityButton = view.findViewById(R.id.btn_share_identity)
     59         blockContactButton = view.findViewById(R.id.btn_block_contact)
     60 
     61         setupUI()
     62     }
     63 
     64     abstract fun setupUI()
     65 }