-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Instagram Not working fix: Add pagination for HistoryFragment
- Loading branch information
1 parent
2886a49
commit 22153be
Showing
27 changed files
with
765 additions
and
560 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
app/src/main/java/com/mugames/vidsnap/database/History.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* This file is part of VidSnap. | ||
* | ||
* VidSnap is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* VidSnap is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with VidSnap. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.mugames.vidsnap.database | ||
|
||
import android.net.Uri | ||
import android.text.format.DateFormat | ||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
import androidx.room.TypeConverters | ||
import com.mugames.vidsnap.utility.UtilityClass | ||
import com.mugames.vidsnap.utility.bundles.DownloadDetails | ||
import java.util.Date | ||
|
||
@Entity(tableName = "HISTORY") | ||
@TypeConverters(DateConverter::class) | ||
class History { | ||
@JvmField | ||
@PrimaryKey(autoGenerate = true) | ||
var id = 0 | ||
@JvmField | ||
var fileName: String? = null | ||
@JvmField | ||
var fileType: String? = null | ||
@JvmField | ||
var source: String? = null | ||
@JvmField | ||
var date: Date? = null | ||
@JvmField | ||
var size: String? = null | ||
@JvmField | ||
var uriString: String? = null | ||
@JvmField | ||
var image: String? = null | ||
|
||
@JvmField | ||
@ColumnInfo(name = "source_url") | ||
var sourceUrl: String? = null | ||
|
||
constructor() {} | ||
constructor(details: DownloadDetails, uri: Uri) { | ||
fileName = details.fileName | ||
fileType = details.fileType | ||
source = details.src | ||
date = DateConverter.toDate(Date().time) | ||
size = details.videoSize.toString() | ||
uriString = uri.toString() | ||
sourceUrl = details.srcUrl | ||
image = UtilityClass.bitmapToString(details.thumbNail) | ||
} | ||
|
||
val uri: Uri | ||
get() = Uri.parse(uriString) | ||
|
||
fun getDate(): String { | ||
return DateFormat.format("dd-MM-yyyy", date) as String | ||
} | ||
|
||
override fun equals(o: Any?): Boolean { | ||
if (this === o) return true | ||
if (o == null || javaClass != o.javaClass) return false | ||
val history = o as History | ||
return fileName == history.fileName && fileType == history.fileType && source == history.source && date == history.date && size == history.size && uriString == history.uriString && image == history.image && sourceUrl == history.sourceUrl | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = id | ||
result = 31 * result + (fileName?.hashCode() ?: 0) | ||
result = 31 * result + (fileType?.hashCode() ?: 0) | ||
result = 31 * result + (source?.hashCode() ?: 0) | ||
result = 31 * result + (date?.hashCode() ?: 0) | ||
result = 31 * result + (size?.hashCode() ?: 0) | ||
result = 31 * result + (uriString?.hashCode() ?: 0) | ||
result = 31 * result + (image?.hashCode() ?: 0) | ||
result = 31 * result + (sourceUrl?.hashCode() ?: 0) | ||
return result | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.