mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Migrated Feedback Data Class to Kotlin
This commit is contained in:
		
							parent
							
								
									4b3c86aefb
								
							
						
					
					
						commit
						3c21f37d7f
					
				
					 1 changed files with 19 additions and 160 deletions
				
			
		|  | @ -1,171 +1,30 @@ | ||||||
| package fr.free.nrw.commons.feedback.model; | package fr.free.nrw.commons.feedback.model | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Pojo class for storing information that are required while uploading a feedback |  * Pojo class for storing information that are required while uploading a feedback | ||||||
|  */ |  */ | ||||||
| public class Feedback { | data class Feedback ( | ||||||
|     /** |     // Version of app | ||||||
|      * Version of app |     val version : String? = null, | ||||||
|      */ |  | ||||||
|     private String version; |  | ||||||
|     /** |  | ||||||
|      * API level of user's phone |  | ||||||
|      */ |  | ||||||
|     private String apiLevel; |  | ||||||
|     /** |  | ||||||
|      * Title/Description entered by user |  | ||||||
|      */ |  | ||||||
|     private String title; |  | ||||||
|     /** |  | ||||||
|      * Android version of user's device |  | ||||||
|      */ |  | ||||||
|     private String androidVersion; |  | ||||||
|     /** |  | ||||||
|      * Device Model of user's device |  | ||||||
|      */ |  | ||||||
|     private String deviceModel; |  | ||||||
|     /** |  | ||||||
|      * Device manufacturer name |  | ||||||
|      */ |  | ||||||
|     private String deviceManufacturer; |  | ||||||
|     /** |  | ||||||
|      * Device name stored on user's device |  | ||||||
|      */ |  | ||||||
|     private String device; |  | ||||||
|     /** |  | ||||||
|      * network type user is having (Ex: Wifi) |  | ||||||
|      */ |  | ||||||
|     private String networkType; |  | ||||||
| 
 | 
 | ||||||
|     public Feedback(final String version, final String apiLevel, final String title, final String androidVersion, |     // API level of user's phone | ||||||
|         final String deviceModel, final String deviceManufacturer, final String device, final String networkType |     val apiLevel: String? = null, | ||||||
|         ) { |  | ||||||
|         this.version = version; |  | ||||||
|         this.apiLevel = apiLevel; |  | ||||||
|         this.title = title; |  | ||||||
|         this.androidVersion = androidVersion; |  | ||||||
|         this.deviceModel = deviceModel; |  | ||||||
|         this.deviceManufacturer = deviceManufacturer; |  | ||||||
|         this.device = device; |  | ||||||
|         this.networkType = networkType; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // Title/Description entered by user | ||||||
|      * Get the version from which this piece of feedback is being sent. |     val title: String? = null, | ||||||
|      * Ex: 3.0.1 |  | ||||||
|      */ |  | ||||||
|     public String getVersion() { |  | ||||||
|         return version; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // Android version of user's device | ||||||
|      * Set the version of app to given version |     val androidVersion: String? = null, | ||||||
|      */ |  | ||||||
|     public void setVersion(final String version) { |  | ||||||
|         this.version = version; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // Device Model of user's device | ||||||
|      * gets api level of device |     val deviceModel: String? = null, | ||||||
|      * Ex: 28 |  | ||||||
|      */ |  | ||||||
|     public String getApiLevel() { |  | ||||||
|         return apiLevel; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // Device manufacturer name | ||||||
|      * sets api level value to given value |     val deviceManufacturer: String? = null, | ||||||
|      */ |  | ||||||
|     public void setApiLevel(final String apiLevel) { |  | ||||||
|         this.apiLevel = apiLevel; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // Device name stored on user's device | ||||||
|      * gets feedback text entered by user |     val device: String? = null, | ||||||
|      */ |  | ||||||
|     public String getTitle() { |  | ||||||
|         return title; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     // network type user is having (Ex: Wifi) | ||||||
|      * sets feedback text |     val networkType: String? = null | ||||||
|      */ | ) | ||||||
|     public void setTitle(final String title) { |  | ||||||
|         this.title = title; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * gets android version of device |  | ||||||
|      * Ex: 9 |  | ||||||
|      */ |  | ||||||
|     public String getAndroidVersion() { |  | ||||||
|         return androidVersion; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * sets value of android version |  | ||||||
|      */ |  | ||||||
|     public void setAndroidVersion(final String androidVersion) { |  | ||||||
|         this.androidVersion = androidVersion; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * get device model of current device |  | ||||||
|      * Ex: Redmi 6 Pro |  | ||||||
|      */ |  | ||||||
|     public String getDeviceModel() { |  | ||||||
|         return deviceModel; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * sets value of device model to a given value |  | ||||||
|      */ |  | ||||||
|     public void setDeviceModel(final String deviceModel) { |  | ||||||
|         this.deviceModel = deviceModel; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * get device manufacturer of user's device |  | ||||||
|      * Ex: Redmi |  | ||||||
|      */ |  | ||||||
|     public String getDeviceManufacturer() { |  | ||||||
|         return deviceManufacturer; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * set device manufacturer value to a given value |  | ||||||
|      */ |  | ||||||
|     public void setDeviceManufacturer(final String deviceManufacturer) { |  | ||||||
|         this.deviceManufacturer = deviceManufacturer; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * get device name of user's device |  | ||||||
|      */ |  | ||||||
|     public String getDevice() { |  | ||||||
|         return device; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * sets device name value to a given value |  | ||||||
|      */ |  | ||||||
|     public void setDevice(final String device) { |  | ||||||
|         this.device = device; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * get network type of user's network |  | ||||||
|      * Ex: wifi |  | ||||||
|      */ |  | ||||||
|     public String getNetworkType() { |  | ||||||
|         return networkType; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * sets network type to a given value |  | ||||||
|      */ |  | ||||||
|     public void setNetworkType(final String networkType) { |  | ||||||
|         this.networkType = networkType; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Neel Doshi
						Neel Doshi