\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{itog} \pdfinfo{ /Title (android-studio.pdf) /Creator (Cheatography) /Author (itog) /Subject (Android Studio Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{44CC00} \definecolor{LightBackground}{HTML}{F3FBEF} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Android Studio Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{itog} via \textcolor{DarkBackground}{\uline{cheatography.com/60099/cs/15708/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}itog \\ \uline{cheatography.com/itog} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 5th May, 2018.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Key Map Setting}} \tn % Row 0 \SetRowColor{LightBackground} Mac OSX & Mac OSX 10.5+ \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Windows/Linux & Default \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{\seqsplit{マウスを使うのはやめましょう}}} \tn % Row 0 \SetRowColor{LightBackground} Cmd + , (Ctrl + Alt + S) & 設定画面 \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Cmd + ; & \seqsplit{プロジェクト設定画面} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} File \textgreater{} Power Save Mode & \seqsplit{バッテリー節約} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Cmd + 1 (Alt + 1) & \seqsplit{プロジェクトペイン} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Cmd + N (Alt + Insert) & 新規ファイル \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Shift + Ctrl + → & \seqsplit{ツールウィンドウ拡大} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Shift + Ctrl + ← & \seqsplit{ツールウィンドウ縮小} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} ESC & \seqsplit{プロジェクトペインからエディタペインへ} \tn % Row Count 17 (+ 3) % Row 8 \SetRowColor{LightBackground} Shift + Cmd + F12 (Shift + Ctrl + F12) & \seqsplit{エディタ最大化} \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} Shift + Cmd + F12 (Shift + Ctrl + F12) & \seqsplit{ツールウィンドウ復帰} \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} Window → Store Current Layout as Default & \seqsplit{レイアウトを保存} \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} Shift + F12 & \seqsplit{デフォルトレイアウトを復帰} \tn % Row Count 26 (+ 2) % Row 12 \SetRowColor{LightBackground} Option + Enter (Alt + Enter) & 空気を読む \tn % Row Count 28 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{検索}} \tn % Row 0 \SetRowColor{LightBackground} Shift + Shift (Shift + Shift) & どこでも検索 \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Cmd + O (Ctrl + N) & \seqsplit{クラス名で検索} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} & \seqsplit{クラス名検索時、*がワイルドカードになる} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} & \seqsplit{クラス名検索時、:数字で行番号指定} \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} & 例)Activ*Bindin:24 \seqsplit{でActivityContributorBindingの24行目} \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} Opt + Cmd + O (Shift + Ctrl + Alt + N) & \seqsplit{シンボル名で検索} \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} & \seqsplit{例)navigationController} \tn % Row Count 17 (+ 2) % Row 7 \SetRowColor{white} Shift + Cmd + O (Shift + Ctrl + N) & \seqsplit{ファイル名で検索} \tn % Row Count 19 (+ 2) % Row 8 \SetRowColor{LightBackground} & 例)build.gradle \tn % Row Count 20 (+ 1) % Row 9 \SetRowColor{white} Shift + Cmd + A (Shift + Ctrl + A) & \seqsplit{アクション検索} \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} & 例)show line number → \seqsplit{Enter(行番行表示トグル)} \tn % Row Count 25 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ファイル切り替え}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl + Tab (+ Tab) (Ctrl + Tab (+ Tab)) & \seqsplit{1つ(2つ)前のファイル} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Cmd + E (Ctrl + E) & \seqsplit{最近開いたファイル} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Shift + Cmd + E (Shift + Ctrl + E) & \seqsplit{最近編集したファイル} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} & \seqsplit{あらゆるポップアップはインクリメンタルサーチできる!} \tn % Row Count 10 (+ 4) % Row 4 \SetRowColor{LightBackground} Cmd + 7(Alt + 7) & \seqsplit{構造ツールウィンドウ} \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} Cmd + F12 (Ctrl + F12) & \seqsplit{構造ポップアップ} \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} Cmd + B (Ctrl + B) & 定義箇所へ \tn % Row Count 15 (+ 1) % Row 7 \SetRowColor{white} Cmd + Y (Shift + Ctrl + I) & \seqsplit{定義をポップアップ確認} \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} Shift + Cmd + F7(Shift +z Ctrl + F7) & \seqsplit{利用箇所をハイライト} \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} Opt + Cmd + B (Ctrl + Alt + B) & \seqsplit{実装へジャンプ} \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} Cmd + P (Ctrl + P) & \seqsplit{パラメータ表示} \tn % Row Count 23 (+ 2) % Row 11 \SetRowColor{white} Cmd + U (Ctrl + U) & \seqsplit{スーパークラスへ} \tn % Row Count 25 (+ 2) % Row 12 \SetRowColor{LightBackground} Cmd + {[} / {]} (Ctrl + Alt + ← / →) & \seqsplit{前(後)の場所へ} \tn % Row Count 27 (+ 2) % Row 13 \SetRowColor{white} Opt + Cmd + F7 (Ctrl + Alt + F7) & \seqsplit{利用箇所のポップアップ} \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} Opt + F7 (Alt + F7) & \seqsplit{利用箇所の検索} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ファイル切り替え (cont)}} \tn % Row 15 \SetRowColor{LightBackground} Cmd + .(Ctrl + .) & \seqsplit{コードを折りたたむ/展開する} \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{white} Shift + Cmd + F (Shift + Ctrl + F) & \seqsplit{プロジェクトを検索} \tn % Row Count 4 (+ 2) % Row 17 \SetRowColor{LightBackground} Shift + Cmd + R (Shift + Ctrl + R) & \seqsplit{プロジェクトで置換} \tn % Row Count 6 (+ 2) % Row 18 \SetRowColor{white} Shift + Alt + クリック & \seqsplit{マルチカーソル} \tn % Row Count 8 (+ 2) % Row 19 \SetRowColor{LightBackground} Ctrl + G & \seqsplit{次の同じ文字列にカーソル配置} \tn % Row Count 11 (+ 3) % Row 20 \SetRowColor{white} Shift + Opt + ↓/↑(Shift + Alt + ↓/↑) & \seqsplit{選択位置を上下に移動} \tn % Row Count 14 (+ 3) % Row 21 \SetRowColor{LightBackground} Ctrl + Space (Ctrl + Space) & 補完候補 \tn % Row Count 16 (+ 2) % Row 22 \SetRowColor{white} Tab (Tab) & 補完(置換) \tn % Row Count 17 (+ 1) % Row 23 \SetRowColor{LightBackground} Enter (Enter) & 補完(挿入) \tn % Row Count 18 (+ 1) % Row 24 \SetRowColor{white} Shift + Cmd + Enter (Shift + Ctrl + Enter) & \seqsplit{ステートメントを完結} \tn % Row Count 21 (+ 3) % Row 25 \SetRowColor{LightBackground} Opt + ↑ (Ctrl + W) & 選択範囲拡大 \tn % Row Count 22 (+ 1) % Row 26 \SetRowColor{white} Opt + ↓ (Shift + Ctrl + W) & 選択範囲縮小 \tn % Row Count 24 (+ 2) % Row 27 \SetRowColor{LightBackground} \seqsplit{最後の編集箇所へ戻る} & Shift + Cmd + Delete (Shift + Ctrl + Backspace) \tn % Row Count 27 (+ 3) % Row 28 \SetRowColor{white} \seqsplit{コードフォーマット} & Opt + Cmd + L (Ctrl + Alt + L) \tn % Row Count 29 (+ 2) % Row 29 \SetRowColor{LightBackground} & \seqsplit{選択しておくと選択箇所のみコードフォーマットできる} \tn % Row Count 33 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ファイル切り替え (cont)}} \tn % Row 30 \SetRowColor{LightBackground} Ctrl + Enter (Ctrl + Enter) & 生成 \tn % Row Count 2 (+ 2) % Row 31 \SetRowColor{white} Shift + Cmd + V(Shift + Ctrl + V) & \seqsplit{クリップッボードの履歴から貼り付け} \tn % Row Count 5 (+ 3) % Row 32 \SetRowColor{LightBackground} Shift + Ctrl + R (Shift + Ctrl + F10) & \seqsplit{カーソル位置で実行} \tn % Row Count 7 (+ 2) % Row 33 \SetRowColor{white} Shift + Ctrl + D () & \seqsplit{カーソル位置でデバッグ} \tn % Row Count 9 (+ 2) % Row 34 \SetRowColor{LightBackground} Shift + F6 (Shift + F6) & リネーム \tn % Row Count 11 (+ 2) % Row 35 \SetRowColor{white} Cmd + Opt + V (Ctrl + Alt + V) & 変数の抽出 \tn % Row Count 13 (+ 2) % Row 36 \SetRowColor{LightBackground} Cmd + Opt + M (Ctrl + Alt + M) & \seqsplit{メソッドの抽出} \tn % Row Count 15 (+ 2) % Row 37 \SetRowColor{white} Ctrl + T (Shift + Ctrl + Alt + T) & \seqsplit{リファクタリング} \tn % Row Count 17 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.28942 cm} x{2.68758 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Version Control}} \tn % Row 0 \SetRowColor{LightBackground} Cmd + 9 (Alt + 9) & Version Control \seqsplit{ツールウィンドウ} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Opt + Cmd + A (Ctrl + Alt + A) & \seqsplit{チェンジリストに追加} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Cmd + K (Ctrl + K) & コミット \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} & \seqsplit{コミット画面では編集が可能} \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} Shift + Cmd + K (Shift + Ctrl + K) & プッシュ \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} Cmd + T (Ctrl + T) & プル \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} Ctrl + V (Alt + Backquote(`)) & \seqsplit{VCSポップアップ} \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} & \seqsplit{ブランチ作成、切り替えはマウス操作の方が早い} \tn % Row Count 16 (+ 4) % Row 8 \SetRowColor{LightBackground} & \seqsplit{プルリクエストはAndroid} \seqsplit{Studio内から作れる} \tn % Row Count 19 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Live \seqsplit{Templateを使いこなそう!}}} \tn % Row 0 \SetRowColor{LightBackground} sout & 標準出力 \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} fun0 & ファンクション \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} fun1 & \seqsplit{引数1つファンクション} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} fun2 & \seqsplit{引数2つファンクション} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} ifn & if null \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} inn & if not null \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Postfix Code Completion}} \tn % Row 0 \SetRowColor{LightBackground} .if & if \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} .nn & not null \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} .not & not \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} .return & return \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} .sout & stdout \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} .try & try-catch \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} .val & val \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} .var & var \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Tips}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{TeamCityを使うとテスト結果の通知をAndroid} \seqsplit{Studio内で受け取ることが出来る}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{Upsourceを使うとAndroid} \seqsplit{Studio内でコードレビュー出来る}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{ナビゲーションバー} Cmd + ↑(Alt + Home)} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Invalidate Caches \& \seqsplit{Restartでインデックスをクリア} \seqsplit{万が一壊れた場合に。}} \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{@jetbrainsjpをフォロー}} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{blog.jetbrains.com/jp \seqsplit{で日本語ブログが読める}} \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{IntelliJ \seqsplit{IDEAを使うとデータベース連携、Webアプリケーション開発も出来る}} \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{IntelliJ \seqsplit{IDEAがお求め安くなる紹介プログラムが最近できたらしい}} \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Android \seqsplit{Studioをもっと詳しく知りたければAndroid} \seqsplit{Studio徹底活用という本が良いらしい}} \tn % Row Count 17 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{今日紹介したようなショートカットにもっと詳しくなりたければIntelliJ} \seqsplit{IDEAハンズオンという本が良いらしい}} \tn % Row Count 20 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}