Skip to content

Commit

Permalink
- Implement Home-Search, Details and Bookmark screens and functionali…
Browse files Browse the repository at this point in the history
…ties

- Add Dagger-Hilt for dependency injection
- Integrate RoomDB for local storage
- Update HomeFragment layout
- Refactor code for files
  • Loading branch information
muradnajafli committed Mar 16, 2024
1 parent 509952b commit bd696b4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ package com.muradnajafli.newscatcher
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import com.muradnajafli.newscatcher.domain.model.Article
import com.muradnajafli.newscatcher.ui.bookmark.BookMarkScreen
import com.muradnajafli.newscatcher.ui.navigation.NewsNavigator
import com.muradnajafli.newscatcher.ui.theme.NewsCatcherTheme
import dagger.hilt.android.AndroidEntryPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.muradnajafli.newscatcher.data.room.SavedNewsDao
import com.muradnajafli.newscatcher.domain.model.Article
import com.muradnajafli.newscatcher.domain.repository.local.SavedNewsRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.onEach
import javax.inject.Inject

class SavedNewsRepositoryImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.muradnajafli.newscatcher.data.retrofit
import com.muradnajafli.newscatcher.data.model.remote.NewsResponse
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface NewsApi {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand All @@ -18,19 +17,11 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand All @@ -41,10 +32,8 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import coil.compose.AsyncImage
import com.muradnajafli.newscatcher.R
import com.muradnajafli.newscatcher.domain.model.Article
Expand Down Expand Up @@ -229,52 +218,6 @@ fun DetailsScreen(
}
}
)

}

}
}

//@Composable
//@Preview(showBackground = true)
//fun DetailsScreenPreview() {
// DetailsScreen(
// topic = "Topic",
// title = "Factbox: Who is still buying Russian crude oil?",
// author = "Jennifer Wars",
// excerpt = "Australia, Britain, Canada and the United States have imposed outright bans on Russian oil purchases following Moscow's invasion of Ukraine, but members of the European Union are split.",
// summary = "(Reuters) - Australia, Britain, Canada and the United States have imposed outright bans on Russian oil purchases following Moscow's invasion of Ukraine, but members of the European Union are split.EU foreign ministers failed to agree on Monday on sanctioning Russian gas and oil supplies, which account for 40% and 27% of the bloc's total use of those commodities respectively.Germany, the EU's top user of Russian crude oil and the Netherlands, a key trading hub, argue that the EU couldn't cut its dependence on Russian supplies overnight.",
// link = "https://www.reuters.com/business/energy/factbox-who-is-still-buying-russian-crude-oil-2022-03-01/",
// media = "https://www.reuters.com/business/energy/factbox-who-is-still-buying-russian-crude-oil-2022-03-01/",
// publishedDate = "2022-03-01",
// onSaveButtonClicked = {
// SavedNews(
// tableId = 0,
// topic = "Topic",
// title = "Factbox: Who is still buying Russian crude oil?",
// media = "https://www.reuters.com/business/energy/factbox-who-is-still-buying-russian-crude-oil-2022-03-01/",
// publishedDate = "2022-03-01"
// )
// }
// )
//}

//@Preview(showBackground = true)
//@Composable
//fun DetailsScreenPreview() {
//
// DetailsScreen(
// article = Article(
// author = "Murad",
// title = "Coinbase says Apple blocked its last app release on NFTs in Wallet ... - CryptoSaurus",
// topic = "Coinbase",
// excerpt = "Coinbase says Apple blocked its last app release on NFTs in Wallet ... - CryptoSaurus",
// summary = "Coinbase says Apple blocked its last app release on NFTs in Wallet ... - CryptoSaurus",
// publishedDate = "2023-06-16T22:24:33Z",
// link = "https://consent.google.com/ml?continue=https://news.google.com/rss/articles/CBMiaWh0dHBzOi8vY3J5cHRvc2F1cnVzLnRlY2gvY29pbmJhc2Utc2F5cy1hcHBsZS1ibG9ja2VkLWl0cy1sYXN0LWFwcC1yZWxlYXNlLW9uLW5mdHMtaW4td2FsbGV0LXJldXRlcnMtY29tL9IBAA?oc%3D5&gl=FR&hl=en-US&cm=2&pc=n&src=1",
// media = "https://media.wired.com/photos/6495d5e893ba5cd8bbdc95af/191:100/w_1280,c_limit/The-EU-Rules-Phone-Batteries-Must-Be-Replaceable-Gear-2BE6PRN.jpg"
// )
// ) {
//
// }
//}
}

0 comments on commit bd696b4

Please sign in to comment.