This file contains hidden or 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
public class FullScreenDialog extends DialogFragment { | |
public static String TAG = "FullScreenDialog"; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setStyle(DialogFragment.STYLE_NORMAL, R.style.FullScreenDialogStyle); | |
} |
This file contains hidden or 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
@Override | |
public void onStart() { | |
super.onStart(); | |
Dialog dialog = getDialog(); | |
if (dialog != null) { | |
int width = ViewGroup.LayoutParams.MATCH_PARENT; | |
int height = ViewGroup.LayoutParams.MATCH_PARENT; | |
dialog.getWindow().setLayout(width, height); | |
} | |
} |
This file contains hidden or 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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
super.onCreateView(inflater, container, savedInstanceState); | |
View view = inflater.inflate(R.layout.layout_full_screen_dialog, container, false); | |
Toolbar toolbar = view.findViewById(R.id.toolbar); | |
toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp); | |
toolbar.setNavigationOnClickListener(view1 -> cancelUpload()); | |
toolbar.setTitle("My Dialog"); |
This file contains hidden or 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
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setStyle(DialogFragment.STYLE_NORMAL, R.style.FullScreenDialogStyle); | |
} |
This file contains hidden or 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
<style name="FullScreenDialogStyle" parent="Theme.AppCompat.Dialog"> | |
<item name="android:windowNoTitle">true</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<!-- Set this to true if you want Full Screen without status bar --> | |
<item name="android:windowFullscreen">false</item> | |
<item name="android:windowIsFloating">false</item> | |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/colorWhite"> | |
<android.support.design.widget.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" > |
This file contains hidden or 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
const path = require("path") | |
exports.createPages = ({ actions, graphql }) => { | |
const { createPage } = actions | |
const blogPostTemplate = path.resolve(`src/templates/blog_template.js`) | |
return graphql(` |
This file contains hidden or 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
import React from 'react' | |
import { graphql } from 'gatsby' | |
import Layout from '../components/layout' | |
const BlogPostTemplate = ({ data }) => { | |
// extract the contents from data | |
const { markdownRemark } = data; | |
const { frontmatter, html } = markdownRemark; |
This file contains hidden or 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
import React from 'react' | |
import { Link, graphql } from 'gatsby' | |
import Layout from '../components/layout' | |
/** ================= This is the function to extract data =================== | |
* Function to create a list of <h1> elements with Post title | |
* @param {*} data | |
*/ |
This file contains hidden or 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
module.exports = { | |
siteMetadata: { | |
title: `Gatsby Default Starter`, | |
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`, | |
author: `@gatsbyjs`, | |
}, | |
plugins: [ | |
`gatsby-plugin-react-helmet`, | |
{ | |
resolve: `gatsby-source-filesystem`, |
NewerOlder